SEO title and meta not working on custom post type

#759015
  • Resolved fusioneffect
    Rank Math free

    I am stuck. We have a custom post type built in CPTUI, and RM isn’t allowing us to append any SEO keywords to the page titles of all these pages.

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

    I’m sorry to hear that you’re facing issues with adding SEO keywords to the page titles of your custom post type pages in Rank Math. To resolve this problem, you can follow these steps:

    1. Check Meta Box Visibility:

      • Make sure that the Meta Box for your custom post type is visible in the editor. You can select the post type where you wish to add the missing Meta Box by following the steps outlined in our guide here.
    2. Enable Add SEO Controls:

      • Once you have selected the correct post type, scroll down in the Titles & Meta settings and ensure that the Add SEO Controls option is enabled. This step is crucial for adding SEO details to your custom post type pages. You can refer to this screenshot for guidance.

    By following these steps, you should be able to append SEO keywords to the page titles of your custom post type pages using Rank Math. If you encounter any further issues or need additional assistance, please feel free to ask.

    Thank you for reaching out and bringing this concern to our attention.

    Sources:
    General Tab in Meta Box of Rank Math SEO Plugin
    Why Rank Math’s Meta Box is Not Showing? » Rank Math

    Hello,

    Thank you for your patience.

    We’ve tried adding a keyword to one of your CPTs, but it seems to be working fine. Please refer to the screencast in the sensitive data section

    Could you please confirm if we have missed some steps to replicate the issue?

    Looking forward to helping you.

    Thanks Reinelle. Yeah it works on the post basis, actually these posts are imported from an external database so I have made the titles how i need them via that, but it was the global settings that didn’t do anything.

    I have a question around that. If it is set as %title% %page% %sep% %sitename%

    Will that take the existing meta title or the post title? Is there a way to select the existing meta title vs post title with the variables?

    Can the global settings override anything I have imported as page title (rank math meta title)?

    Hello,

    Thank you for your patience.

    If you have set a custom meta title per post, then it will take priority over the title in the Titles & Meta option.

    In this case, you may need to use this filter to force the use of the global meta title in Rank Math:

    add_action( 'rank_math/frontend/title', function( $generated ) {
    	global $post;
    	if ( is_single() && $post->post_type == 'CPT-NAME') { // change to the actual CPT name
          return $generated;
    	}
    	$title = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_title" );
    	$title = RankMath\Helper::replace_vars( $title, $post );
    	return $title;
    });

    Here’s a link to how to apply this to your site:
    https://rankmath.com/kb/filters-hooks-api-developer/

    Hope that helps.

    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘SEO title and meta not working on custom post type’ is closed to new replies.