How to add RSS sitemap to WordPress

Home - WordPress Security - How to add RSS sitemap to WordPress
rss-sitemap
Maps are required to navigate the area when visiting a new tourist attraction. You might have also noticed several landmarks in a single hoarding at the start that refer to various popular places in the area.

A sitemap is a file (hoarding) that contains a list of all the websites (landmarks) on your website (tourist destination) that are visible and accessible to both search engines and humans. It makes it easier for users to navigate the website and for search engines to index the page. Let's define sitemaps and see how to add RSS sitemap to WordPress.

What is RSS Sitemap?

An RSS sitemap (Really Simple Syndication) also called as feed is an internet file that lists every piece of content published by a website. When a site publishes new content, details about it are automatically produced in the file and displayed in reverse chronological order, such as the subject matter or a synopsis, citation, publisher, reference, and so on.

Why do we need RSS sitemap?

  • RSS Sitemap give all site updates, allowing Google to index your content more frequently.
  • It enhances the website's and its contents' general usability.
  • In the event of a slow network, RSS sitemap can be used to decide the material a user wishes to access without having to visit the website.
  • It determines the value of website in terms of relevant keywords which are included in sitemap.
  • It increases the website’s visibility in search engines by making the search crawlers consider all the links attached in the sitemap.

Attributes of RSS Feeds

RSS content is encoded in XML and displayed by a feed-reader or an RSS-integrated Web browser on the client host. These are some of the attributes of RSS feed: -

  • Title – Title of the article. Try to keep the most used keywords here.
  • Description – A short summary of what the article is about.
  • Image – It’s an add on to the blog as it describes the content of your article pictorially.
  • Link – URL to the main article.

The difference between XML and RSS is that XML contains the whole body of sitemaps whereas RSS feed is the format in which you can render the sitemaps which is primarily based on XML. So it’s advised to use both simultaneously.

How to add an RSS sitemap to WordPress?

There are two ways in which we can add RSS sitemaps to WordPress:

1. Dashboard

Repeat the process mentioned above from step b to f. After completing, you will be able to see the preview of WordPress RSS Feed.

Click on Publish to apply the changes to website.

a. Plugins

Plugin provides more customization options than the WordPress Customizer, allowing you to improve compatibility. Steps to be followed are:

  • Install the plugin by going to Dashboard >> Plugins >> Add New.
  • Choose the plugin you want to add. Some of the best plugins for WordPress RSS are:
  • All in one SEO
  • Feedzy RSS Feeds
  • WP RSS Aggregator
  • Search the plugin and then click on Install and further activate the plugin.

For example, we will use WP RSS Aggregator to add sitemaps. To add RSS feed, goto RSS Aggregator >> Add New.

  • Add the title of the feed on the top of the screen.
  • Get URL of the feed you wish to use.
  • Click on Publish to apply the changes to website.
  • To display the feeds on your site, simply add this shortcode in a WordPress post or page: [wp-rss-aggregator].
  • For that goto Dashboard >> Pages >> All Pages
  • Select the webpage in which the feed should be shown and click on Edit.
  • Paste [wp-rss-aggregator <parameter>] wherever you wish to display in the webpage and then click on Update.

How to create custom WordPress RSS Feed?

There are two methods to create a custom WordPress RSS Feed:

1. Plugin

The simplest method is to use a plugin to generate a customised WordPress RSS feed because it allows customization with just a few clicks. Simply configure the plugin to create your own WordPress RSS feed. As an illustration, consider the WP RSS Aggregator plugin.

  • Add the RSS feed source file to WP RSS Aggregator.
    If you wish to add an external RSS feed files, then simply type ‘/rss’ at the end of the website’s URL. For example - https://www.hindustantimes.com/rss

    In case ‘/rss’ doesn’t work, then use ‘/feed’ or simply google <website name> feed.
  • After downloading the feed file, . use Validate Feed Source to make sure that you are sourcing from the right sources.
  • Give your RSS feed a name and add the URL source for your RSS feed in the URL field.Enter your text here...
the URL source for your RSS feed
  • Customize additional settings such as include a feed limit and display only unique titles. Once you’re done, click Publish.
  • The RSS feed will then appear under Published tab in Feed Items in WP RSS Aggregator.
  • You can add multiple feeds like this and enable or disable as per the requirements. Now follow the same steps as mentioned in How to add an RSS sitemap to WordPress?

Here you can customize as per the needs. If you wish to further customise the feed manually in plugin, then:

  • Goto Dashboard >> Pages >> All Pages.
  • Select the webpage in which the feed should be shown and click on Edit
  • Paste the shortcode [wp-rss-aggregator <parameter>]. Now there are various parameters through which you can customise the feeds WordPress RSS.
feeds WordPress RSS.
  • Click on Update after customising the shortcode.

If you wish to further enhance the display then:

  • Goto Dashboard >> Appearance. Search for your favourite theme and then activate it.
  • Goto RSS Aggregator >> Settings. You As shown in the figure below, a new tab with the label "Feed To Post" is automatically added to your RSS Aggregator settings.
  • One can find General Settings that can be customized. You can set them according to your preferences.

2. Manually

In several instances, WordPress also allows to make manual updates. If your server supports cPanel, you can manual process WordPress RSS sitemaps for your WordPress site using File Manager or File Transfer Protocol (FTP). The steps are as follows:

  • Always keep a backup copy of your data. This can be fulfilled by using FileZilla to copy all of your files or by using backup plugins. Make a backup plan in case something goes wrong.
  •  Using any FTP client, reach the root of the directory of your site. Find functions.php file and right-click to edit using Notepad.
  • Once you have the functions.php file open, paste the following code:
Custom WordPress Web Development

add_action ('init', 'customRSS');
function customRSS(){
      add_feed('feedname', 'customRSSFunc');
}

  • After adding a new feed, you must generate a callback function that is used to initiate and complete a routine and generate the feed. rss is the slug (name of the feedfile created and saved in WordPress).

function customRSSFunc() {
get_template_part('rss', 'feedname');
}

  • Save the functions.php file and close it.
  • To create a new feed template for WordPress RSS, create a new file called rss.php (we are keeping the same name as of slug) and save it in the folder where you edited the functions.php file.
  • In rss.php, paste the following code and save it.

<?php
/**
* Template Name: Custom RSS Template - Feedname
*/
$postCount = 5; // The number of posts to show in the feed
$posts = query_posts('showposts=' . $postCount);
header(‘Content-Type: '.feed_content_type('rss-http’).'; charset=' .get_options('blog_charset'), true);
echo ‘<?xml version="1.0" encoding="'.get_option( ‘blog_charset’).'"?'.'>';
?>
<rss version="2.0"
xmlns:content="https://purl.org/rss/1.0/modules/content/"
xmlns:wfw="https://wellformedweb.org/CommentAPI/"
xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
<?php do_action(‘rss2_ns'); ?>>
<channel>
<title><?php bloginfo_rss(‘name'); ?> - Feed</title>
<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
<link><?php bloginfo_rss(‘url') ?></link>
<description><?php bloginfo_rss(‘description') ?></description>
<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
<language><?php echo get_option('rss_language'); ?></language>
<sy:updatePeriod><?php echo apply_filters( ‘rss_update_period', ‘hourly’ ); ?></sy:updatePeriod>
<sy:updateFrequency><?php echo apply_filters( ‘rss_update_frequency’, '1' ); ?></sy:updateFrequency>
<?php do_action('rss2_head'); ?>
<?php while(have_posts()) : the_post(); ?>
<item>
<title><?php the_title_rss(); ?></title>
<link><?php the_permalink_rss(); ?></link>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
<?php do_action(‘rss2_item'); ?>
</item>
<?php endwhile; ?>
</channel>
</rss>

  • Finally, you'll need to reset your WordPress rewrite rules until you can view the feed. Logging into the WordPress admin and going to Settings -> Permalinks is the simplest way to do this. Simply click Save Changes to force the rewriting rules to be flushed. Your website now has a custom RSS feed that you can tailor to your specific requirements.

Optimize WordPress RSS Feed

RSS feeds are a must-have tool for increasing traffic to your website and enhancing your overall search engine ratings. Some of the tips for optimization are:-

  1. RSS Feed Security
    Content scraping occurs when information from your webpage is taken and reposted as their own on other websites, typically through use of your RSS feed. This can narrow your audience and raise your bounce rate. To customise your RSS feed, adjust the configurations in WordPress.

  2. Display a Snippet Instead of the Full Material
    Your audience will be eligible to read your posts from their feed reader once they can see the complete article from your RSS feed. It will have an impact on your website's overall page hits, conversion rates, and advertising revenues. Make the observing content small enough that viewers must click to read the entire article. Suspense building is always effective!

    Go to Settings >> Reading >> For each post in a feed, include. Select Excerpt radio button

  3. Offer your feed a punchy name.
    In most instances, your feed will be named after your website. If the name does not correspond to the character of your website, crawler reach will be ineffective. So, if the website's name is related to nature, such as Aurora, try and keep the feed's name consistent with that name.

  4. Add Social Buttons to Your WordPress RSS Feeds
    Although most RSS feed clients lack social sharing functionality, you can still add your own social icons to your RSS feed. It will assist you in persuading your viewers to share your content. You can include sharing buttons for Twitter and Facebook. More people sharing your RSS feed and website will improve your results.

Find WordPress RSS Feed Url

If you wish to find WordPress RSS Feed URL, then simply type “/feed” or “/rss” after the website’s name.

You can even find it through source code. Go to the website and right-click on the page. Go to View Page Source (Ctrl+U or Command+U) and then press Ctrl+F or Command+F. Type feed in the dialog box. Look for Feed href=”” attribute. The WordPress RSS Feed URL is located inside “”.

Conclusion

It is strongly advised for newbies to use plugins for ease of processing, as creating custom WordPress RSS sitemaps can be a difficult task. However, as a beginner, if you want to steadily grow the readership of your website, a customised WordPress RSS feed is a must. Helpbot's specialists test a variety of useful plugins for your comfort, and our developers create unique RSS feeds from the backend. If you want your website to take off, we could indeed help you get there. We can be reached by phone.

CLIENTS REVIEWS