Hello,
We apologize for the issue you are facing with the feed URLs on your website. Rank Math does not have a built-in option to disable RSS feeds, as WordPress automatically generates these feeds. However, you can disable them by adding some code to your theme’s functions.php
file.
Here’s how you can do it:
- Backup your website to ensure easy recovery if anything goes wrong.
- Create a child theme if you haven’t already, to prevent changes from being overwritten during theme updates.
- Access your
functions.php
file in your active theme or child theme.
-
Add the following code to disable the RSS feeds:
// Disable RSS Feeds and redirect to homepage
function disable_rss_feeds() {
wp_redirect(home_url());
exit();
}
add_action('do_feed', 'disable_rss_feeds', 1);
add_action('do_feed_rdf', 'disable_rss_feeds', 1);
add_action('do_feed_rss', 'disable_rss_feeds', 1);
add_action('do_feed_rss2', 'disable_rss_feeds', 1);
add_action('do_feed_atom', 'disable_rss_feeds', 1);
add_action('do_feed_rss2_comments', 'disable_rss_feeds', 1);
add_action('do_feed_atom_comments', 'disable_rss_feeds', 1);
// Remove RSS feed links from header
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
- Save the changes.
After implementing this code, when users try to access your feed URLs, they will be redirected to your homepage instead.
If you prefer not to add code manually, you can also use a WordPress plugin like Disable Everything to easily disable your RSS feeds.
If you have any further questions or need assistance, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further!
Sources:
How to Disable RSS Feeds in WordPress » Rank Math
Hello,
Thank you for contacting Rank Math support.
You can follow this guide to disable the feed URL: https://rankmath.com/kb/disable-rss-feeds/
We hope this helps you resolve the issue. Let us know if you need assistance with anything else.
Thank you.
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.