|
/ Documentation /Developers Documentation/ Customize Final Title Tag surerank_final_title

Customize Final Title Tag surerank_final_title

Hook: surerank_final_title

Description: The surerank_final_title filter changes the HTML document title after SureRank processes a frontend request, including applicable posts, archives, searches, and 404 pages. It does not change every social metadata field.

Source: inc/frontend/title.php

Usage: The filter receives $title and $meta_title as strings and must return a string. Register two accepted arguments when using both. Scope your callback to the intended pages.

Example:

PHP
add_filter( 'surerank_final_title', static function ( $title ) {
    return is_page( 123 ) ? 'About Acme' : $title;
} );

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top