{"id":11789,"date":"2022-01-27T10:09:28","date_gmt":"2022-01-27T15:09:28","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=11789"},"modified":"2022-01-27T10:09:31","modified_gmt":"2022-01-27T15:09:31","slug":"how-to-stop-wordpress-from-displaying-a-cached-rss-feed","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/","title":{"rendered":"How to Stop WordPress From Displaying a Cached RSS Feed"},"content":{"rendered":"\n

WordPress can be a powerful tool for publishing all sorts of websites with their own content. One of the strengths of WordPress<\/a> is that it is able to pull in content from other websites using RSS. This content can then be displayed on your website. The common problem with this feature is that in most cases WordPress will show a cached RSS feed.<\/p>\n\n\n\n

Having cached results in your RSS feed may not be ideal especially when the content is being sourced from a site that has fast-updating posts. So this is something the website owner may want to address.<\/p>\n\n\n\n

How to Fix Cached RSS Feed<\/h2>\n\n\n\n

Disable the RSS Feeds Cache Entirely<\/h2>\n\n\n\n

This can be done by adding action on the wp_feed_options<\/code> WordPress hook. This modification will disable caching on the RSS feed.<\/p>\n\n\n\n

Add the following code to the functions.php<\/code> file:<\/p>\n\n\n\n

function turn_off_feed_caching( $feed ) {\n    $feed->enable_cache( false );\n}\nadd_action( 'wp_feed_options', 'turn_off_feed_caching' );<\/code><\/pre>\n\n\n\n

Change the RSS Feed Cache Refresh Cycle<\/h2>\n\n\n\n

You can use an anonymous function and add a wp_feed_cache_transient_lifetime<\/code> filter that returns the refresh timer in seconds. This example will refresh after 15 minutes (900 seconds):<\/p>\n\n\n\n

add_filter('wp_feed_cache_transient_lifetime', function () {\n return 900;\n});<\/code><\/pre>\n\n\n\n

Conclusion<\/h2>\n\n\n\n

That’s it. The next time you create a new post on your WordPress site the RSS Feed will be cached. For the second example, it will be refreshed after 15 minutes.<\/p>\n\n\n\n

Refs:
[
1<\/a> ] – wp_feed_options WordPress Hook
[
2<\/a> ] – wp_feed_cache_transient_lifetime WordPress Hook<\/p>\n","protected":false},"excerpt":{"rendered":"

WordPress can be a powerful tool for publishing all sorts of websites with their own content. One of the strengths of WordPress is that it is able to pull in…<\/p>\n","protected":false},"author":1,"featured_media":11791,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,27,16],"tags":[101,320,424,433,449,452,471,591,635,636,638,651],"yoast_head":"\n[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed<\/title>\n<meta name=\"description\" content=\"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed\" \/>\n<meta property=\"og:description\" content=\"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-27T15:09:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-27T15:09:31+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Stop WordPress From Displaying a Cached RSS Feed\",\"datePublished\":\"2022-01-27T15:09:28+00:00\",\"dateModified\":\"2022-01-27T15:09:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\"},\"wordCount\":226,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg\",\"keywords\":[\"Blogging\",\"Internet\",\"Open Source\",\"Optimization\",\"Performance\",\"PHP\",\"Programming\",\"Tools\",\"Web\",\"Web Applications\",\"Web Development\",\"WordPress\"],\"articleSection\":[\"Articles\",\"Guides\",\"How To\",\"Programming\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\",\"url\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\",\"name\":\"[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg\",\"datePublished\":\"2022-01-27T15:09:28+00:00\",\"dateModified\":\"2022-01-27T15:09:31+00:00\",\"description\":\"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg\",\"width\":1280,\"height\":680,\"caption\":\"Stop WordPress From Displaying a Cached RSS Feed\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Stop WordPress From Displaying a Cached RSS Feed\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed","description":"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/","og_locale":"en_US","og_type":"article","og_title":"[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed","og_description":"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle","og_url":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2022-01-27T15:09:28+00:00","article_modified_time":"2022-01-27T15:09:31+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Stop WordPress From Displaying a Cached RSS Feed","datePublished":"2022-01-27T15:09:28+00:00","dateModified":"2022-01-27T15:09:31+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/"},"wordCount":226,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg","keywords":["Blogging","Internet","Open Source","Optimization","Performance","PHP","Programming","Tools","Web","Web Applications","Web Development","WordPress"],"articleSection":["Articles","Guides","How To","Programming","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/","url":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/","name":"[Solved ] How do I Stop WordPress From Displaying a Cached RSS Feed","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg","datePublished":"2022-01-27T15:09:28+00:00","dateModified":"2022-01-27T15:09:31+00:00","description":"This is how you can stop WordPress from displaying a cached RSS feed by either disabling them or setting a short refresh cycle","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2022\/01\/Displaying-Cached-RSS-Feed.jpg","width":1280,"height":680,"caption":"Stop WordPress From Displaying a Cached RSS Feed"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/how-to-stop-wordpress-from-displaying-a-cached-rss-feed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Stop WordPress From Displaying a Cached RSS Feed"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11789"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=11789"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/11789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/11791"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=11789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=11789"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=11789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}