to the theme header, and // some print nothing at all. Declaring support ourselves is the documented // fix and is a no-op when the theme already did it. add_action('after_setup_theme', [$this, 'ensureTitleTagSupport'], 20); } public function ensureTitleTagSupport() { if (!current_theme_supports('title-tag')) { add_theme_support('title-tag'); } } public function filterTitle($title) { if (!$this->shouldFilter()) { return $title; } $resolved = Resolver::title(); return '' !== $resolved ? $resolved : $title; } public function filterLegacyTitle($title) { return $this->filterTitle($title); } /** * Feeds keep WordPress' own titles, and admin/REST requests have no business * running the front-end title pipeline at all. */ protected function shouldFilter() { if (is_feed() || is_admin()) { return false; } if (defined('REST_REQUEST') && REST_REQUEST) { return false; } return (bool) apply_filters('rankify_filter_document_title', true); } }