Skip to content

Snippet: Alter Main Page Title

// Example showing how to alter the page title, adjust accordingly to match your needs
add_filter( 'wpex_title', function( $title ) {
    // Change the products title to their actual title
    if ( function_exists( 'is_product' ) && is_product() ) {
        $title = get_the_title();
    // Return the title
    return $title;
}, 20 );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top