Single Post Title/Description For Posts Under A Particular Category

#453546
  • Resolved Efeikomwan Obasuyi
    Rank Math free

    Hello Admin.

    Please forgive my bad English.

    I have configured SEO Title and Description from Rankmath global settings. and it works fine.

    But now I want to ask,

    How can I make posts from a particular category not to use the SEO Title and Description from Rankmath global settings?

    For Example:
    I have a category titled Top Music, now I don’t want the post on that category to use Rankmath SEO Title and Description from global settings.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with disabling the global meta title and description for posts in a specific category.

    Rank Math does not have the function to disable global meta by category. You will have to create a function with code using the filter below:

    
    /**
     * Allow changing the meta description sentence from within the theme.
     *
     * @param string $description The description sentence.
     */
    add_filter( 'rank_math/frontend/description', function( $description ) {
    	return $description;
    });
    

    You can refer to our guide for other code snippets and how to implement them: https://rankmath.com/kb/filters-hooks-api-developer/

    Hope that helps. Please let us know if you have questions.

    Thanks you for your response.

    But, I’m not a developer, just a WordPress dashboard user.

    Will it be okay if I drop my WP-Admin login details for you to help implement it for me?

    Hello,

    Sure, please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    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,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Nigel
    Rank Math business

    Hello,

    I added the code snippet below using the Code snippets plugin. To change the Title and description, replace the text in quotes on the indicated lines:

    
    /**
     * Allow changing the meta description sentence from within the theme.
     *
     * @param string $description The description sentence.
     */
    add_filter( 'rank_math/frontend/description', function( $description ) {
    	global $post;
    	if (has_category('latest-hollywood-movies')){//category slug
    		$description = "Download %title% - Free download Movie for Mobile in the best quality format. Also stream %title% on your mobile, tablets, and iPads."; //Replace description in quotes
    	}
    	return $description;
    });
    
    /**
     * Filter to change the page title.
     * 
     * @param string $title
     */
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	global $post;
    	if (has_category('latest-hollywood-movies')){ //category slug
    		$title = "%title% Full Movie Download %sep% Melody Blog"; //Replace title in quotes
    	}
    	return $title;
    });
    

    Please note, I have deactivated the snippet, you will need to click activate in the snippets plugin for it to start working.

    Hope that helps. Please let us know if you have questions.

    Thank you so much, I really appreciate your help.

    Thank you.

    But, when creating post for that particular category, I can still see the global title and description still showing instead of the custom title and description from the snippet plug-in.

    Screenshot: https://ibb.co/qxKkfnN

    Hello,

    The snippet might be different in preview since you are forcing the title/description to be changed via our filter. Please check the post’s page source instead and the custom title/description should appear there on the frontend.

    Hope that helps.

    Thank you.

    Thank you.

    I will monitor the changes and get back to you.

    Thanks

    Hello,

    I am glad that we could address your concern. Sure, do let us know how that goes on your end. Looking forward to helping you.

    Thank you.

    Thank you so much.

    It’s working as expected.

    Thank you
    I appreciate.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    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.

    Thanks.
    I’ll do just that..
    I appreciate…

    Hello,

    Thank you for that confirmation, and we appreciate your time in taking the review.

    If you have any other concerns, please don’t hesitate to contact us anytime to assist you further.

    Looking forward to helping you.

    Thank you.

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

The ticket ‘Single Post Title/Description For Posts Under A Particular Category’ is closed to new replies.