custom post type

#161164
  • Resolved Simon Vaulks
    Rank Math free

    Hi,

    I’m trying to disable Rank Math for a custom post type, when I use your provided hook it does indeed disable Rank Math but then I get no meta title at all output for that post type, it’s like it’s disabling the title tag altogether.

    It does the same for any page if I change the code to:

    add_action( ‘wp_head’, ‘rankmath_disable_features’,1);
    function rankmath_disable_features() {
    if(is_singular(‘page’)) {
    remove_all_actions( ‘rank_math/head’);
    }
    }

    SO I believe your code is disabling the titles for the whole of WordPress.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    The filter you’re using removes all the Rank Math output for the post type that’s why you’re not getting a meta title.

    Are there any specific outputs that you want to disable? Let us know so we can assist you further.

    We are looking forward to helping you.

    Yes, I know that, I want to disable Rank Math output on one post type only.

    But when I use your code, it removes the WordPress default title tag too.

    So with your code I have no title tag whatsoever.

    Prabhat
    Rank Math agency

    Hello,

    Thanks for your reply!

    To target a single post, you can use the below code:

    /**
     * Replace the ID with post ID
    **/
    if( $post->ID == 1) {
        /****Do Your Stuff Here****/
    }

    You can get the post ID by editing the post. Please see this screenshot: https://i.rankmath.com/6MQXJp

    Hope this helps.

    Thanks!

    That is no use to me, your code stops the default WordPress title from being output.

    I need the WordPress title of the post to be output.

    Can you help?

    I tried adding

    add_theme_support( ‘title-tag’ );

    To my functions.php but Rank Math is still stripping out the WordPress title.

    I am using the latest WP + Hello Elementor theme. I have tried other themes, but it is the same with those too.

    Hello,

    Please try by adding the code given below for the post types you’re disabling Rank Math:

    echo get_post_meta($post->ID, 'rank_math_title', true);

    Let us know if this works for you or not. We really look forward to helping you.

    Sorry, no, that doesn’t work.

    Code removed

    With your code Rank Math is removing the WordPress title from the WordPress head.

    There’s just empty lines where the <title> should be.

    I need to remove the Rank Math output but leave the default WordPress <title> of the post or page in place.

    I’ve downloaded Plugin Organiser, I figured it’d be easier to disable Rank Math completely for the post types I don’t need it on, seeing as your provided code removes the WP title as well.

    Hello,

    We are glad to know that you got that sorted.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘custom post type’ is closed to new replies.