Archive Page: Remove from Sitemap No Index

#169530
  • Resolved Loisgriffin
    Rank Math free

    Hi I have a similar issue to the following ticket – I have an archive page that is in this format and Google Search Console doesn’t like it cos it is a 400 bad request – domain.com/%listingLocation%/%listingCat%/

    I was able to remove this archive page from site map on Yoast by selecting NO in the section ‘show listing archive page in search results?’

    The following ticket issue seems the closest to what I’m experiencing as I still wanting the Listing pages to appear in search results but not the listing archive page url I have noted above. However looking at the ticket it appears I am required to write custom code that wasn’t revealed –

    https://support.rankmath.com/ticket/custom-post-type-archive-pages-remove-from-sitemap-no-index/

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    You would need to modify this filter to target the listing archive page and set this to noindex

    /**
     * Allows filtering of the robots meta data.
     *
     * @param array $robots The meta robots directives.
     */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    	return $robots;
    });

    However, I’ve passed your concern to our dev team to provide you an example of how to target that URL. We really appreciate your kind patience regarding this matter.

    Meanwhile, please don’t hesitate to contact us anytime to assist you further with anything else.

    Thank you.

    Yes thank you if someone could send an example of how to target that URL, I would very much appreciate it 🙂

    Anonymous
    Rank Math free

    Hello,

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

    We need to take a closer look at the settings. Can you please edit the first post on this ticket and include your WordPress & FTP logins in the designated 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.

    Thanks

    Hi,

    I’ve activated the temporary login plugin you suggested. Could you provide me with an email address to assign the temporary login to please ?

    Many thanks,

    L

    Hello,

    Please provide access to the email s******@r***********.

    Looking forward to helping you.

    Hello,

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

    Thank you.

    Anonymous
    Rank Math free

    Hi, We are really sorry for being late in your issue.

    I have added the correct code in your theme’s functions.php Here I am sharing code with you

    add_filter( 'rank_math/sitemap/post_type_archive_link', function ( $link ) {
    
     	if ( strpos( $link, '%listingLocation%' ) !== false ) {
     		return false;
     	}
    
    	return $link;
    } );

    You can now check the sitemaps below –

    https://elopementweddingplanner.com/listing-sitemap.xml
    https://elopementweddingplanner.com/package-sitemap.xml

    Let me know if you have any other questions.

    Thank you

    That’s great thank you!

    Hello,

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

    If you don’t mind us 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 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 ‘Archive Page: Remove from Sitemap No Index’ is closed to new replies.