Remove specific URL from sitemap

#865314
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing. To remove a specific URL, such as the checkout page, from your sitemap in Rank Math, you can follow these steps:

    1. Navigate to the Rank Math Dashboard: Go to your WordPress dashboard and click on Rank Math SEO.
    2. Sitemap Settings: Click on Sitemap Settings.
    3. Exclude URLs: In the settings, you should find an option to exclude specific URLs from the sitemap. You can add the checkout page URL here to ensure it is not included in the sitemap.

    If you need further assistance or if this does not resolve your issue, please reply to this ticket, and a human agent from the Rank Math Support team will overtake the ticket and assist you further.

    Thank you for raising this concern!

    Sources:
    Is It Possible to Disable the URL /local-sitemap.xml? » Rank Math

    Hello,

    You can remove the URL by setting the checkout page to noindex.

    Alternatively, you can use and customize this filter on your site to remove it from your sitemap:

    add_filter( 'rank_math/sitemap/entry', function ( $url, $type, $object ) {
    
            $urls_to_skip = array(
                    'https://www.yoursite.com/checkout-page'
            );
    
            if ( isset( $url['loc'] ) && in_array( $url['loc'], $urls_to_skip ) ) {
                    return false;
            }
    
            return $url;
    }, 10, 3 );

    You may refer to this guide on how to add filters to your website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

The ticket ‘Remove specific URL from sitemap’ is closed to new replies.