Remove Seo on a single page

  • Hello,

    I’m creating a dynamic page for my site and for that, I need to remove SEO for the specific page.

    i use this code :

    add_action( 'template_redirect', 'rankmath_disable_features' );
    function rankmath_disable_features() {
    if( is_page( '800' ) ) {
        remove_all_actions( 'rank_math/head' );
    }
    }

    but with this code, the title tag was also removed.

    • This topic was modified 2 weeks, 1 day ago by Mohnish.
    • This topic was modified 2 weeks, 1 day ago by Mohnish.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math today.

    You can modify your code to the following to add the title tag:

    add_action( 'template_redirect', 'rankmath_disable_features' );
    function rankmath_disable_features() {
    if( is_page( '800' ) ) {
        remove_all_actions( 'rank_math/head' );
        add_action( 'rank_math/head', '_wp_render_title_tag', 1 );
    }
    }

    Looking forward to helping you. Thank you.

    ​​​​​​

    Yeah, it’s working but still, I’m not able to overwrite title dynamically.

    Hi there,

    Thanks for getting back to us.

    You should be able to change the title from the Rank Math metabox on the back end or your can use the following filter to dynamically change the title:

    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	return $title;
    });

    I hope this info helps. Thank you.

    No, but still title comes via rank math

    <!-- Search Engine Optimization by Rank Math - https://s.rankmath.com/home -->
    <title>demo - title</title>
    <!-- /Rank Math WordPress SEO plugin -->

    and because of that my overwriter rule not working properly, I create the function

    add_filter('wpseo_title', 'filter_product_wpseo_title');
    function filter_product_wpseo_title($title) {
       if ( is_page(800)) {
            add_action( 'wpseo_title',              __CLASS__ .'::generate_meta_tags', 15, 1 );
            
        }
        return $title;
    }

    which is properly working with Yoast but with rank math title was still not overwriter because of its come via plugin.

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    Temporary Login Without Password

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    WP Security Audit Log

    We really look forward to helping you.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this ticket.