WordPress 4.4 to Deprecate the wp_title Function

A year after WordPress 4.1 introduced a new way to display titles in themes, WordPress 4.4 will deprecate wp_title(). With the change, plugin authors will be able to check for theme support and use a few new filters to manipulate the title. The new filters are as follows:

  • 'pre_get_document_title' short-circuits wp_get_document_title() if it returns anything other than an empty value.
  • 'document_title_separator' filters the separator between title parts.
  • 'document_title_parts' filters the parts that make up the document title, passed in an associative array.

Theme authors should no longer use wp_title() to generate document titles. If theme authors add add_theme_support( ‘title-tag’ ); to the after_setup_theme callback, the title will be handled natively via an internal WordPress core function. If you use a theme that utilizes wp_title and have wp_debug enabled in WordPress 4.4, you’ll see a deprecation notice.

In general, users who upgrade to WordPress 4.4 won’t notice a difference. However, with nearly a month to go before WordPress 4.4 is released, theme developers are highly encouraged to check and update their themes accordingly.

There are 4 comments

Comments are closed.