Remove Seo on a single page

#19670
  • Resolved Mohnish
    Rank Math free

    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 5 years, 1 month ago by Mohnish.
    • This topic was modified 5 years, 1 month 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.

    ​​​​​​

    Mohnish
    Rank Math free

    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.

    Mohnish
    Rank Math free

    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:

    https://wordpress.org/plugins/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):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Remove Seo on a single page’ is closed to new replies.