
Every WordPress Feed URL
These work on every WordPress site with "pretty permalinks". Replace example.com and the parts in capitals.
| Feed | URL |
|---|---|
| Latest posts (RSS 2.0) | https://example.com/feed/ |
| Latest posts (Atom) | https://example.com/feed/atom/ |
| Latest posts (RSS 1.0 / RDF) | https://example.com/feed/rdf/ |
| All comments | https://example.com/comments/feed/ |
| Comments on one post | https://example.com/POST-SLUG/feed/ |
| Category | https://example.com/category/SLUG/feed/ |
| Tag | https://example.com/tag/SLUG/feed/ |
| Author | https://example.com/author/USERNAME/feed/ |
| Search results | https://example.com/?s=KEYWORDS&feed=rss2 |
| Custom post type | https://example.com/feed/?post_type=TYPE |
| Several categories | https://example.com/?cat=3,7&feed=rss2 |
Without pretty permalinks, use query strings: ?feed=rss2, ?feed=atom, ?cat=3&feed=rss2. WordPress adds autodiscovery tags for the main feed and comments feed to your theme's head automatically through add_theme_support('automatic-feed-links').
Feed Settings in WordPress
Under Settings › Reading:
- Syndication feeds show the most recent – the number of items in each feed. 10 is the default; 20 to 30 is better for sites that publish several times a day.
- For each post in a feed, include – Full text or Excerpt. Full text puts the whole article in
content:encoded; readers prefer it. See full content or summaries.
Feeds are cached by most caching plugins and CDNs. After changing these settings, clear the cache and check the result with the Feed Validator.
Code Snippets to Improve Your Feed
Add these to a small plugin or your child theme's functions.php.
Add the Featured Image to Every Item
Readers show thumbnails from media:content. WordPress doesn't add it by default:
add_action('rss2_ns', function () {
echo 'xmlns:media="http://search.yahoo.com/mrss/" ';
});
add_action('rss2_item', function () {
if (!has_post_thumbnail()) return;
[$url, $w, $h] = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
printf('<media:content url="%s" medium="image" width="%d" height="%d" />' . "\n", esc_url($url), $w, $h);
});Delay Posts in the Feed
Published a post with a typo? A short delay gives you time to fix it before feed readers copy it:
add_filter('posts_where', function ($where, $query) {
global $wpdb;
if ($query->is_feed() && $query->is_main_query()) {
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_date_gmt < %s", gmdate('Y-m-d H:i:s', time() - 15 * MINUTE_IN_SECONDS));
}
return $where;
}, 10, 2);Include Custom Post Types in the Main Feed
add_action('pre_get_posts', function ($query) {
if ($query->is_feed() && $query->is_main_query() && !$query->get('post_type')) {
$query->set('post_type', ['post', 'podcast', 'video']);
}
});Exclude a Category from the Feed
add_action('pre_get_posts', function ($query) {
if ($query->is_feed() && $query->is_main_query()) {
$query->set('category__not_in', [12]);
}
});Add a Footer to Every Item
add_filter('the_content_feed', function ($content) {
return $content . sprintf('<p>Originally published on <a href="%s">%s</a>.</p>', esc_url(get_permalink()), esc_html(get_bloginfo('name')));
});Turn Feeds Off
Some sites (shops, intranets) don't need feeds. Remove the autodiscovery links and redirect feed requests to the home page:
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
foreach (['do_feed', 'do_feed_rdf', 'do_feed_rss', 'do_feed_rss2', 'do_feed_atom'] as $hook) {
add_action($hook, fn() => wp_redirect(home_url(), 301) && exit, 1);
}Turning off feeds also stops feed readers, aggregators and many automation tools from following your site. Only do it if you are sure.
Fixing Common WordPress Feed Errors
| Error | Cause | Fix |
|---|---|---|
| XML declaration allowed only at the start of the document | Whitespace or a blank line before <?xml, usually after a closing ?> in functions.php or a plugin | Remove closing ?> tags at the end of PHP files; disable plugins one by one to find the culprit |
| Feed shows HTML or a 404 page | Permalinks out of date, a security plugin or a maintenance mode | Save Settings › Permalinks once; check plugin settings |
| Old posts reappear as new | GUIDs changed after a domain or HTTPS migration | Don't search-replace the guid column in wp_posts |
| Feed not updating | Page cache or CDN caching the feed too long | Exclude /feed/ from long caching or purge on publish |
| Readers get "403 Forbidden" | Firewall or bot protection blocking feed readers | Allow-list feed URLs in your security plugin or CDN |
| Strange characters | Copy-pasted control characters or a broken charset | Check blog_charset is UTF-8; validate the feed to find the item |
Podcasting with WordPress
A WordPress category feed with audio enclosures can serve as a basic podcast feed, but it lacks the Apple Podcasts tags. Podcast plugins (such as Seriously Simple Podcasting or PowerPress) add those tags, artwork and a dedicated podcast feed. Check the result against the requirements in Podcast RSS.
Sources and Further Reading
- WordPress FeedsWordPress Developer Resources
- fetch_feed()WordPress Developer Resources
- RSS 2.0 SpecificationRSS Advisory Board