Hide the category description on the page2 of blog category!

#539716
  • Resolved Alin Dragoescu
    Rank Math free

    Hello there,
    I have try to resolve the duplicate problem for one blog category.
    I have add the below variable: %page%, %pagenumber%.
    The meta title it’s OK and Meta decsription.
    But, please let me know how i can hide the description for visitors? on the category page 2, 3, etc..? I want to show the category description only on the first category page ..
    I hope you understend me..πŸ™‚

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

    Thank you for contacting Rank Math and bringing your concern to our attention.

    You can use this filter to remove the meta description on the category pagination:

    add_action( 'rank_math/head', function() {
    if ( is_category() && is_paged()) {
    add_filter( 'rank_math/frontend/description','__return_false');
    }
    });

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

    Hope that helps.

    Thank you.

    Hello ad many thank’s for your reply,

    I have try this code but not work for my website:
    For example, here it’s my page:
    https://www.firme365.ro/anunturi-diverse/

    On the description i write “test”.

    And on the second page:
    https://www.firme365.ro/anunturi-diverse/page/2/

    i have also the description visible for the visitors “test”

    I want to hide the description for /page/2 , page/3/ etc…

    The code that i have add it’s:

    <php

    /**
    * 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;
    });

    Many regards

    Hello,

    Please try to use the following filter on your site and see if that works for you.

    add_filter( 'rank_math/frontend/description', function( $description ) {
        if ( is_category() && is_paged()) {
            return false;
        }
        return $description;
    });
    

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Hello,

    I have add the code on the file that i have created rank-math.php and still not work.

    On page 2 https://www.firme365.ro/anunturi-diverse/page/2/ it’s stil visible the description.

    The code that i have right now on the page it’s:

    <php
    
    /**
    * Allow changing the meta description sentence from within the theme.
    *
    add_filter( 'rank_math/frontend/description', function( $description ) {
        if ( is_category() && is_paged()) {
            return false;
        }
        return $description;
    });

    Many regards

    Hello,

    We might need to take a closer look at the settings. 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/

    Looking forward to helping you.

    Thank you.

    Hello,

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

    Thank you.

    Hello and many thank’s!

    I have send you the wp-admin data!

    many thank’s for help me!
    I make the back up also!

    Many regards

    Hello there,

    I have remove the page tha i have created because i see there was a lot of errors!
    I am verry sory about

    Hello,

    We’ve applied the above filter to your function.php and it is working properly. Please check the screenshots below:


    However, I can see the filter you’ve shared above is missing the closing comment tag. If you don’t want to apply this filter to your function.php then you can use any of the methods mentioned in the guide below:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.

    Thank you.

    Ah, I see that’t work perfect!
    But i speack about the description that’s visible by the user.

    Many regards

    Hello,

    The category description that’s visible in the frontend is being added by the theme. They might have created some filters / actions when added makes it’s not visible on frontend.

    I would suggest posting the question to their support forum and they can share the code to hide it from frontend.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    Hello,

    That fine and I thank you for your response.

    You are the Best one.. πŸ€šπŸ€šπŸ‘πŸ‘

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Hide the category description on the page2 of blog category!’ is closed to new replies.