WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Create Custom RSS Feeds in WordPress

How to Create Custom RSS Feeds in WordPress

Last updated on February 19th, 2016 by Editorial Staff
87 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Create Custom RSS Feeds in WordPress

WordPress comes with built-in default RSS feeds. You can tweak the default feeds by adding custom content to your RSS Feeds, or even adding post thumbnail to your RSS Feeds. The default RSS and Atom feeds are enough for most users, but you may wish to create a custom RSS feed for delivering specific type of content. In this article, we will show you how to create custom RSS feeds in WordPress.

Please note that this tutorial is not intended for beginner level WordPress users. If you are a beginner, and still want to try it, then please do so on a local install.

As always, you must create a complete backup of your WordPress website before making any major changes to a live website.

Having said that, let’s get started with your first custom RSS feed in WordPress.

Let’s assume you want to create a new RSS feed which displays just the following information:

  • Title
  • Link
  • Published Date
  • Author
  • Excerpt

First thing you need to do is create the new RSS feed in your theme’s functions.php file or in a site-specific plugin:


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

The above code triggers the customRSS function, which adds the feed. The add_feed function has two arguments, feedname, and a callback function. The feedname will make up your new feed url yourdomain.com/feed/feedname and the callback function will be called to actually create the feed. Make a note of the feedname, as you’ll need this later on.

Once you have initialized the feed, you’ll need to create the callback function to produce the required feed, using the following code in your theme’s functions.php file or in a site specific plugin:

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

The code above is using the get_template_part function to link to a separate template file, however you can also place the RSS code directly into the function. By using get_template_part, we can keep the functionality separate to the layout. The get_template_part function has two arguments, slug and name, that will look for a template file with the name in the following format, starting with the file at the top (if it doesn’t find the first, it will move on to the second, and so on):

  1. wp-content/themes/child/rss-feedname.php
  2. wp-content/themes/parent/rss-feedname.php
  3. wp-content/themes/child/rss.php
  4. wp-content/themes/parent/rss.php

For the purposes of this tutorial, it is best to set the slug to the type of feed you’re creating (in this case: rss), and the name to the feedname configured earlier on.

Once you’ve told WordPress to look for the feed template, you’ll need to create it. The below code will produce the layout for the feed with the information we listed earlier. Save this file in your theme folder as the slug-name.php template file configured in the get_template_part function.

<?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_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
?>
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://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>
                        <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
                        <dc:creator><?php the_author(); ?></dc:creator>
                        <guid isPermaLink="false"><?php the_guid(); ?></guid>
                        <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
                        <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
                        <?php rss_enclosure(); ?>
                        <?php do_action('rss2_item'); ?>
                </item>
        <?php endwhile; ?>
</channel>
</rss>

This template code will generate an RSS feed following the above layout. The postCount variable allows you to control the number of posts to display in your feed. The template can be amended as required to display whatever information you require (e.g. post images, comments, etc).

The the_excerpt_rss function will display the excerpt of each post, and for posts that do not have excerpts, it will display the first 120 words of the post’s content.

Finally, to display your feed, you’ll first need to flush your WordPress rewrite rules. The easiest way to do this is by logging in to the WordPress admin, and clicking Settings -> Permalinks. Once here, just click Save Changes, which will flush the rewrite rules.

You can now access your new feed at yourdomain.com/feed/feedname, where feedname was the feedname you gave in the add_feed function earlier on.

The W3C offers a feed validation service, allowing you to validate the resulting feed.

Troubleshooting

  • I’m getting a 404 error when trying to view my feed!
    • Check to see if you are using the correct feedname in your URL. It has to be the one you supplied in the add_feed function
    • If you have the correct feedname, your rewrite rules may not have flushed correctly. Re-save your permalinks just to be sure.
    • If you’ve re-saved your permalinks, you can force a rewrite flush via your theme’s functions.php file. Add the following code to the customRSS function we created earlier. Make sure you add the code after the add_feed function.
    • global $wp_rewrite;
      $wp_rewrite->flush_rules();
      
    • Once you’ve added this, reload your WordPress site. NOTE: This should be removed immediately after use. Once is enough for the rules to be flushed.
  • My feed isn’t validating!
    • Using the W3C feed validator, specific details should be given where your feed isn’t validating. Edit the feed template file to resolve these issues
  • I’m getting a <language /> validation error!
    • This is common where the RSS language has not been configured on your WordPress installation. To do this, you can add the following code to your theme’s functions.php file, to update the language option.
    • function rssLanguage(){
              update_option('rss_language', 'en');
      }
      add_action('admin_init', 'rssLanguage');
      
    • Edit the second argument of the update_option function to change the language to one you require. Check out the full list of RSS Language Codes.
    • Once the above code has been added to your functions file, load the WordPress admin screen for it to take effect. After this, the code should be removed from your WordPress functions file. Loading it once is enough to configure the rss_language setting.
    • This can also be done directly in the database, by looking for the rss_language option in the wp_options table.

We hope this article helped you create your own custom RSS Feeds in WordPress. Let us know how and why you will be using custom RSS feeds on your WordPress site by leaving a comment below.

87 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

64 Comments

Leave a Reply
  1. Dexter Nelson says:
    Jan 20, 2021 at 1:16 pm

    Is there any way to make this permanent? I keep having to repeat this step every few weeks when the theme is updated.

    Reply
    • WPBeginner Support says:
      Jan 21, 2021 at 9:48 am

      For that, you would want to create a child theme following our guide below:

      https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/

      Reply
      • Dexter Nelson says:
        Jan 27, 2021 at 3:31 pm

        Thanks. But doesn’t that mean when the theme is updated I’ll have to update the child theme? If that’s the case and I have to put in the work either way, I might as well put in the work to create and maintain a plugin and help out others instead of just myself, right?

        Reply
        • WPBeginner Support says:
          Jan 28, 2021 at 9:43 am

          Child themes should not be affected by updates to the parent theme but if you have the ability to create a plugin then you can certainly go down that path to help others as well.

  2. Thommy Kusbin says:
    Oct 24, 2020 at 2:49 am

    is there any plugin to do this kind of custom rss feed XML? I want to use my own tag xml.

    Reply
    • WPBeginner Support says:
      Oct 26, 2020 at 11:20 am

      We do not have a recommended plugin at this time, we will be sure to keep an eye out.

      Reply
  3. MOOSA says:
    Feb 18, 2018 at 2:32 pm

    How can I use “wp_get_shortlink()” Instead of “the_permalink_rss()”

    Reply
  4. John Snyder says:
    Oct 6, 2017 at 4:52 pm

    I need to create an XML feed for a specific page on my WordPress website. Here is the page will I have to edit my functions.php file or is there an easier way?

    Reply
  5. Alok Shrestha says:
    Sep 19, 2017 at 4:44 am

    Hello,

    This article is very helpful but I got some issue.

    I did exactly like in your code. But it gives me an error as
    This page contains the following errors:

    error on line 1 at column 7: XML declaration allowed only at the start of the document
    Below is a rendering of the page up to the first error.

    Could you please help me out what could possibly go wrong here?
    This is very important for me.

    Thank you.

    Reply
    • Nathan says:
      Oct 23, 2017 at 6:57 am

      I got the same error. Did you figure out the fix?

      Reply
      • Rich says:
        Jan 24, 2018 at 9:47 am

        Use ob_clean(); after php tag

        Reply
  6. Guillermo says:
    Apr 6, 2017 at 1:06 am

    Hi, is it possible to change de order of the posts in my feeds without creating a new custom feed? I want to use the current feed files but just want to change the displayed order of theme. Using PHP queries as an example, changing order from DESC to RAND()

    I will appreciate you help. Thanks.

    Reply
  7. Jeremy says:
    Apr 4, 2017 at 1:58 pm

    Great post! I definitely fall under the rookie status. Many feed readers/aggregators don’t seems to like the /feed/ URL structure, even through the xml returned validates. Is there a way to append the url to end with rss.xml?

    Reply
    • Dave says:
      Oct 13, 2017 at 12:57 am

      Did you get this to work with .xml at the end?

      Reply
  8. JDURAN says:
    Mar 12, 2017 at 4:42 pm

    Sorry to say, however, implementing the codes for custom rss has effectively wiped out my entire blog. Having to do a restore and it is taking a long time to get my blog back up. Any advise?

    Reply
    • Mark says:
      Apr 13, 2017 at 9:03 am

      You need to connect to your site via FTP or your hosting’s file browser in cPanel, and simply remove what you added. If you added the code as a custom plugin, then just rename the plugin folder. If you added the code in functions.php, edit the file and remove the code. Don’t forget to backup the file before editing. Hope this helps for the next time.

      Reply
  9. jim says:
    Mar 3, 2017 at 11:57 am

    Fantastic! This works as advertised!

    Reply
  10. DrLightman says:
    Feb 27, 2017 at 11:56 am

    Never mind, it does. I had a bug with YOAST SEO that with the /category/ prefix removal. I have warned them of it I hope they will fix it.

    Reply
  11. DrLightman says:
    Feb 27, 2017 at 6:24 am

    Hello, thank you for the article, but it seems this will only work for the main site feed, not for the specific catgories feeds:

    mysite.com/category/mycat/feed/feedname/

    Reply
  12. Manuel says:
    Feb 4, 2017 at 11:17 am

    Doesn’t work anymore.
    I got a 404 error, so I activated debug mode. Debug mode says “Notice: The Called Constructor Method For WP_Widget Is Deprecated Since Version 4.3.0! Use __construct()”

    Reply
    • Manuel says:
      Feb 4, 2017 at 11:24 am

      Ok, I think the problem was elsewhere and this notice is from a different plugin.

      Reply
  13. git says:
    Nov 12, 2016 at 2:21 pm

    unfortunately this is restricted in its usefulness. inserting screenshots and sample pages would be very helpful, particularly for amateurs/rookies like me.

    Reply
  14. Tiffany says:
    Oct 14, 2016 at 2:43 pm

    Great article. Any way to add the featured image for the post to the feed?

    Reply
    • WPBeginner Support says:
      Oct 16, 2016 at 4:07 pm

      Please see our guide on how to add featured image to your WordPress RSS feed.

      Reply
  15. CT says:
    Sep 28, 2016 at 3:12 pm

    Please see below screenshots – what determines the “…” or “[…]” or “Read More ->” etc etc in feeds?

    I’m using the default /feed in 2 different WP sites & these 2 screenshots obviously are showing something different at the end of their excerpts. Thanks!

    Reply
  16. CT says:
    Sep 27, 2016 at 6:00 pm

    Apologizes but that code did not come through clear lol. Lets try that again. Go here to see the exact, raw code I’m looking to remove:

    Reply
    • WPBeginner Support says:
      Sep 27, 2016 at 7:48 pm

      This code is added by Yoast SEO plugin to RSS feeds. You can turn it off by visting SEO » Advanced page.

      Reply
  17. Stef says:
    Aug 1, 2016 at 2:42 pm

    Hey, I want to exclude certain post_formats from my custom rss feed. Is that possible and if so, how?

    Reply
  18. Neha says:
    Jul 20, 2016 at 1:14 am

    Hello,

    When I try to view the feed I got 404 Page not found error. I am trying to add code:

    global $wp_rewrite;
    $wp_rewrite->flush_rules();

    then I also got same error. Could this be why?

    Reply
  19. Jordan says:
    May 30, 2016 at 8:52 am

    How do you add multiple feeds? Array is not working. Thanks.

    Reply
  20. Jon Harvey says:
    May 26, 2016 at 10:31 pm

    How would you add multiple custom feeds? Couldn’t get an array to work.
    Thanks

    Reply
    • Jon Harvey says:
      May 31, 2016 at 6:32 pm

      Got it to work neatly thanks to birgire at Stack exchange:

      add_action( ‘init’, ‘custom_feeds’ );

      function custom_feeds()
      {
      foreach( array( ‘feedname1’, ‘feedname2’ ) as $name )
      {
      add_feed( $name,
      function() use ( $name )
      {
      get_template_part( ‘rss’, $name );
      }
      );
      }
      }

      Reply
  21. Neal Pope says:
    May 3, 2016 at 2:41 pm

    The “follow” button shows up at the bottom right corner when viewing posts on a personal computer, but does not appear when viewing on a mobile devise (smartphone) (unless I’m just missing it.

    Reply
  22. Limbani says:
    Mar 1, 2016 at 12:45 am

    Thanks for sharing it’s work perfectly…

    Reply
  23. Jeff says:
    Feb 19, 2016 at 10:18 am

    Sorry, but everything about this is misleading. this is not “beginner” work. and it is not worded for beginners. This is totally irresponsible and can cause major issues to people’s websites.

    Reply
    • WPBeginner Support says:
      Feb 19, 2016 at 8:47 pm

      We have updated the article to add a note about this.

      Reply
  24. Christine says:
    Oct 28, 2015 at 2:06 pm

    I got this working (kind of). The feed page exists, but will not validate and says there is an error on line 1.

    I copied the code exactly from this page and haven’t changed anything. What could be going wrong here?

    Reply
    • Flávia says:
      Jan 21, 2016 at 5:19 am

      W3 will not validate mine as well and says there is an error on line 17.

      And I am getting the 404 page!

      What should I do?

      Reply
  25. Eugene Asiamah says:
    Jul 16, 2015 at 5:04 pm

    Hello,

    Please i need help in configuring my rss to show all my post content on not just an excerpt of it.

    Thank you.

    Reply
  26. Georgi says:
    Jul 3, 2015 at 8:10 am

    Hello,
    I need to show only date without time for pubDate. When I use

    It’s doesn’t work for firefox,IE.
    Can you help me?

    Thank you in advance!

    Reply
  27. Jan-Philipp says:
    Apr 12, 2015 at 4:49 am

    Hi.

    I would like to change the update pattern of the feed with

    sy:updatePeriod
    echo apply_filters( ‘rss_update_period’, ‘weekly’ );
    /sy:updatePeriod

    sy:updateFrequency
    echo apply_filters( ‘rss_update_frequency’, ‘1’ );
    /sy:updateFrequency>

    sy:updateBase
    2015-03-29T01:00:00+09:00
    /sy:updateBase

    But whatever I tried, it automatically adds a new post when I publish it and does not wait till Sunday ( as defined in the code above) to add it to the RSS.

    Do you have any suggestions? Do I maybe need to find a solution within the WP Query?

    Your help would be much appriciated.

    Reply
  28. Jan-Philipp says:
    Apr 12, 2015 at 4:40 am

    Hi.

    I would like to change the update pattern of the feed with

    2015-03-29T01:00:00+09:00

    But whatever I tried, it automatically adds a new post when I publish it and does not wait till Sunday ( as defined in the code above) to add it to the RSS.

    Do you have any suggestions? Do I maybe need to find a solution within the WP Query?

    Your help would be much appriciated.

    Reply
  29. Issabellla says:
    Mar 27, 2015 at 12:24 am

    Hi.I try to do as your mention but I’ve seen my site cannot access to the feed page.This is My site I try to use /feed and a lot of word which is mention in wordpress.com or wordpress.org even in the google.Please help me.

    Reply
    • WPBeginner Support says:
      Mar 29, 2015 at 2:40 pm

      Your site’s feed looks fine to us.

      Reply
  30. xuamox says:
    Jul 8, 2014 at 7:30 pm

    What determines that the feed will be displayed at feed/feedname? I have tried to follow the tutorial, but not luck at all. The feed is not publishing at feed/feedname.php

    Reply
  31. Wouter Bertels says:
    May 8, 2014 at 5:09 pm

    Following these exact steps I got this error:

    Fatal error: Cannot redeclare get_bloginfo_rss() (previously
    declared in
    /home/public_html/wp-includes/feed.php:25)
    in /home/public_html/wp-content/themes/xxx/rss-name.php on line 39

    Reply
  32. George says:
    Apr 29, 2014 at 2:34 pm

    Hi,

    My feed is OK when this code is added:

    global $wp_rewrite;
    $wp_rewrite->flush_rules();

    and returns a 404 when it is removed.
    I only remove it as per your instructions, which is to remove it after reloading wordpress.

    At this moment I am testing it on my local server. Could this be why?

    Reply
  33. ybmgryzzz says:
    Apr 29, 2014 at 8:04 am

    Hi there. Thanks for this post! Really appreciated. Worked well at first go! :)

    I would also like some assistance as Brian below. For the full text in the RSS instead of the post excerpt.

    Thanks in advance.

    Reply
  34. Brian says:
    Feb 24, 2014 at 2:37 pm

    I am trying to add a second RSS feed that is full text (my first RSS feed is summary). If I wanted this custom RSS feed to be full text instead of summary excerpt, what would I change?

    Thanks so much!

    Reply
  35. Steve Marks says:
    Feb 19, 2014 at 2:55 am

    Thanks for this. Just what I was looking for!

    I had an issue when I used add_feed(). I could view the RSS feed in the browser absolutely fine, but it would return a 404 when I entered the URL into a third party application (ie. MailChimp, W3C feed validator etc). I had tried flushing the permalinks etc.

    The only way I could get round the issue was to create a new blank page and select the template as the one you’ve outlined in this article.

    Not sure why it didn’t work, but hopefully this offers a viable solution for others in this situation.

    Thanks again!

    Reply
  36. Josh McClanahan says:
    Feb 16, 2014 at 1:20 am

    Your article is right on the path of what I was looking for. One question I have (as a noob to RSS), how can I add a link to an RSS feed?
    The site that I need this for is a church and would like to have a custom feed that would make it easier for our members to be alerted to newly posted sermon posts (that have mp3 download links).
    Currently, the feed shows the text for the links that I have created on the posts for the sermons. But it only acts as text. Any help would be appreciated.

    Reply
    • Josh McClanahan says:
      Feb 19, 2014 at 5:57 pm

      Just noticed that I didn’t ask my question correctly.
      What I was trying to ask was, how can I display a link in the RSS Feed? The links that are in the content of my posts are broken in the feed.
      Thanks for your help and this article.

      Reply
    • Josh McClanahan says:
      Mar 1, 2014 at 9:32 am

      Still curious, if anyone knows why my links would be broken and only show as plain text in a feed?
      To see what I mean checkout: http://amfmchurch.com/feed
      You will see “Download” in plain text. I would like to make it so that people can click the anchor link and download the mp3. This works find on the actual site.

      Thanks for any help.

      Reply
  37. Neil says:
    Jan 11, 2014 at 7:08 pm

    Hi, I have the default rss feed.. but I would like to be able to either reduce the size of the images from what is displayed in the post…. (to a maximujm width of 265px) OR to just use the post thumbnail in the rss.

    Is either of the above possible?

    The reason I am looking to do this is that my RSS feeds an APP and the APP will only display images up to 265px in width (before horizontal scrolling) and 265px is very limiting for online/pc blog posts…

    Reply
  38. Cathy Finn-Derecki says:
    Dec 10, 2013 at 6:12 pm

    Thank you for this! I am making a custom RSS location part of a plugin I’m developing. As a result, I have included the text for the custom RSS in the function, not in a theme template. It’s working. However, it does not seem to work when I want to restrict the feed to a category. It gives all posts regardless. Any thoughts?

    Reply
    • WPBeginner Support says:
      Dec 13, 2013 at 7:58 pm

      try changing

      $posts = query_posts('showposts=' . $postCount);
      

      To:

      $posts = query_posts('showposts=' . $postCount.'&category_name=staff');

      Replace category_name with your category name.

      Reply
      • Francisco Espinoza says:
        Oct 12, 2017 at 5:16 pm

        Hi Guys. How can I use this to exclude three categories from my new custom feed? What do you suggest?

        Reply
  39. Alexis says:
    Nov 23, 2013 at 3:57 pm

    Hello,

    Thank you, these explanations are really useful. I just used it to customize my feed so I could put an image in mailchimp’s “RSS to email” feature.

    Thank you very much !

    Reply
  40. the Off says:
    Nov 14, 2013 at 3:52 am

    Hello,

    Till yesterday afternoon, my WordPress (version 3.6.1) blog http://theoff.info/wordpress/ had no problem. And I successfully added new plugins.

    In the night, problems started: (1) I could not login. (2) the RSS feed http://theoff.info/wordpress/?feed=rss2 got corrupted. The feed failed validation.

    I searched the Web and WordPress Support Forum for solutions. I tried the following:
    (i) successfully reset the password
    (ii) deleted new plugins from ftp
    (iii) renamed Theme folder by adding “-old” and plugin folder by adding “-hold” from ftp

    Then I could login and up grade to 3.7.1 version and make changes to the blog.

    However, login is still an issue. Every time I am following method mentioned in step (iii) to login.

    RSS still does not validate.

    Could you help in resolving both login and RSS feed problems?

    Note: My webhost does not offer technical help. I am not an IT professional i.e. I have very little technical knowledge.

    Thanks

    Reply
    • WPBeginner Support says:
      Nov 19, 2013 at 11:29 pm

      It is difficult to figure out. Here is one thing you can try.

      1. Using FTP download your plugins to your computer for backup and then delete your plugins directory.
      2. Create a new plugins directory.
      3. Install and all your plugins one by one by downloading fresh copy of the plugin from the source. After you activate each plugin log out and and log back in to see if the problem occurs again. You will probably find a plugin that may be causing the problem or you wont. This could mean that a plugin file on your site may have been compromised.

      If this process does not help you, repeat this process process with your themes as well. If you have made a lot of changes to your existing themes then you might want to back it up on your computer by downloading theme folder through FTP. Then delete themes folder from your webserver and create a new themes directory in wp-content folder on your server. From WordPress admin area download and install a fresh copy of default twenty thirteen theme.

      Let us know what happens when you do all that. Make Sure to Backup your Site first.

      Reply
  41. Bertrand says:
    Oct 26, 2013 at 5:28 am

    Hello,

    When I try to open the new feed, I get an error message:

    Fatal error: Call to undefined function query_posts() in /xxxx/wp-content/themes/xxx/rss-feedname.php on line 6

    I tried on localhost and web hosting, it is the same…

    How can I fix it?

    Thanks

    Reply
    • Bertrand says:
      Oct 28, 2013 at 11:51 am

      My fault: http://wordpress.org/support/topic/error-message-call-to-undefined-function-query_posts?replies=5

      Reply
  42. ADv says:
    Oct 18, 2013 at 8:01 am

    Does the php template need close tag ?> in the end?

    Reply
    • ADv says:
      Oct 18, 2013 at 9:03 am

      No, it doesn’t. Silly me = )

      Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WPForms Logo
WPForms
Drag & Drop WordPress Form Builder Plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
LiveChat logo
LiveChat Inc Coupon
Get a 30 day free trial and 30% OFF LiveChat, one of the best live chat service providers for WordPress users.
LearnDash
LearnDash Coupon
Get the lowest price on the best learning management system (LMS) plugin for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.