{"id":189,"date":"2008-07-28T22:01:03","date_gmt":"2008-07-29T03:01:03","guid":{"rendered":"http:\/\/cssnewbie.com\/?p=189"},"modified":"2008-07-28T22:01:03","modified_gmt":"2008-07-29T03:01:03","slug":"hiding-content-in-your-rss-feed","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/hiding-content-in-your-rss-feed\/","title":{"rendered":"Hiding Content in Your RSS Feed"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2008\/07\/rssfeed.gif\" alt=\"\" title=\"RSS feed\" width=\"400\" height=\"200\" class=\"alignnone size-full wp-image-190\" \/><\/p>\n<p>I\u2019ve been doing a bit of research lately on creating RSS-only content for my website \u2013 that is, content that shows up in my RSS feed and nowhere else. My research has a specific purpose: I\u2019m planning to start a contest on CSSnewbie in the very near future. The contest would by available only to people who subscribe to my RSS feed, meaning I\u2019d need to provide some sort of clue or password in my RSS, but nowhere else. <\/p>\n<p>My searching has lead me to two very nice WordPress plugins that should do the job that I need to do. I\u2019ve also come up with a way to accomplish the same feat using just HTML and CSS.<\/p>\n<p><a href='http:\/\/yoast.com\/wordpress\/rss-footer\/'><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2008\/07\/rss-footer.gif\" alt=\"\" title=\"RSS Footer\" width=\"400\" height=\"171\" class=\"alignnone size-full wp-image-191\" \/><\/a><\/p>\n<p>The first WordPress plugin I came across is called <strong>RSS Footer<\/strong> (<a href=\"http:\/\/yoast.com\/wordpress\/rss-footer\/\">you can find RSS Footer here<\/a>). It\u2019s a simple plugin, originally written in order to include some sort of a copyright message at the top or bottom of your RSS entries. This in itself probably wouldn\u2019t be a bad idea \u2013 there\u2019s a lot of websites out there that simply grab random articles with certain keywords from other sites and display them as their own. I know that a lot of CSSnewbie articles, for example, end up on other sites.<\/p>\n<p>However, it occurs to me that this plugin could also be used to insert some sort of a \u201csecret\u201d message to your RSS subscribers. Just install the plugin, write your message, and the plugin will automatically bypass your website\u2019s content and insert your message into the RSS feed, before it gets shipped off to the end user (or to services like <a href=\"http:\/\/www.feedburner.com\/\">FeedBurner<\/a>). Viola! Instant contest.<\/p>\n<p><a href='http:\/\/www.blogclout.com\/blog\/goodies\/feed-footer-plugin\/'><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2008\/07\/feed-footer.gif\" alt=\"\" title=\"Feed Footer\" width=\"400\" height=\"137\" class=\"alignnone size-full wp-image-192\" \/><\/a><\/p>\n<p>Or, if you\u2019d prefer a little more flexibility in your options, the <strong>Feed Footer WordPress plugin<\/strong> might be a better way to go (<a href=\"http:\/\/www.blogclout.com\/blog\/goodies\/feed-footer-plugin\/\">get a copy of Feed Footer here<\/a>). Feed Footer is similar to RSS Footer, in that it allows you to insert arbitrary content into your RSS feed before your users or FeedBurner see it. However, Feed Footer\u2019s solution is a little different. When using Feed Footer, you cannot insert your content into the top of your RSS entries \u2013 it has to appear at the bottom (hence \u201cfooter,\u201d I suppose). However, instead of a single boilerplate message, you can include up to ten different messages in your feed, which will rotate through as you add new articles to your website.<\/p>\n<p>There are many benefits to this option, not the least of which as it relates to advertising. Using Feed Footer, you could insert several different advertisements into your RSS feed and have them rotate through. But there are also benefits as it relates to our contest idea: you needn\u2019t give the same clue\/password\/whatever on the same two days. In fact, maybe only one out of every three blog posts even has a clue, requiring your subscribers to stay subscribed (and active) for long enough to find the message.<\/p>\n<p>But what if you aren\u2019t using WordPress, or feel like a plugin might be overkill in this situation? Well, there\u2019s another option out there, an HTML- and CSS-only option.<\/p>\n<p>This idea takes advantage of the fact that, unlike screen and print versions of  your website, your RSS feed tends to be unstyled \u2013 all those fancy CSS rules you write for your website get stripped away when readers use the RSS feed instead. Normally, I see that as a bit of a downside, but in this instance, it\u2019s perfect for what we want to do.<\/p>\n<p>In this scenario, our \u201csecret message\u201d is included as part of the regular article. We just do our best to ensure that only those who are meant to see it (i.e., the RSS readers) ever do.<\/p>\n<p>We\u2019ll start by giving our secret message a CSS class, something like \u201crssonly\u201d or the like:<\/p>\n<pre lang=\"html4strict\" escaped=\"true\" line=\"1\">\n&lt;p class=&quot;rssonly&quot;&gt;Be sure to drink \nyour Ovaltine!&lt;\/p&gt;\n<\/pre>\n<p>Now, all we need to do is create a CSS rule that ensures that the message we\u2019ve written doesn\u2019t see the light of day in normal circumstances:<\/p>\n<pre lang=\"css\" escaped=\"true\" line=\"1\">.rssonly {\n\tdisplay: none; }<\/pre>\n<p>That\u2019s really the fundamentals of it right there. Be sure to add the class to both your screen and <a href=\"http:\/\/cssnewbie.com\/7-tips-print-style-sheets\/\" title=\"7 Tips for Great Print Style Sheets\">print stylesheets<\/a> (assuming you have both). This will prevent the text from showing up on the screen or page, but it\u2019ll be plain as day in your RSS feed.<\/p>\n<p>Of course, what\u2019s to stop some unscrupulous soul from looking at your website\u2019s source code and divining the answer without having to subscribe to your feed? Not much at all, that\u2019s what. Although, you could make the quest a little more difficult by encoding your message by converting your text to its ASCII equivalents. All you need to do is find a <a href=\"http:\/\/getyourwebsitehere.com\/jswb\/text_to_ascii.html\">simple text-to-HTML-ASCII converter<\/a> online, type in your message, and then copy the resulting HTML codes into your page. For example, when converting our secret message above, we get something like this:<\/p>\n<pre lang=\"html4strict\" escaped=\"true\" line=\"1\">&lt;p class=&quot;rssonly&quot;&gt;&amp;#66;&amp;#101;\n&amp;#32;&amp;#115;&amp;#117;&amp;#114;\n&amp;#101;&amp;#32;&amp;#116;&amp;#111;&amp;#32;\n&amp;#100;&amp;#114;&amp;#105;&amp;#110;\n&amp;#107;&amp;#32;&amp;#121;&amp;#111;\n&amp;#117;&amp;#114;&amp;#32;&amp;#79;\n&amp;#118;&amp;#97;&amp;#108;&amp;#116;\n&amp;#105;&amp;#110;&amp;#101;\n&amp;#33;&lt;\/p&gt;<\/pre>\n<p>When displayed on the screen (in, say, an RSS feed), the content would be perfectly readable. But it looks like an awful lot of gibberish if you\u2019re just viewing the source code. And sure, someone could still take the time to decode your ASCII entities and avoid subscribing to your RSS feed that way. But really, if they\u2019re willing to do that much work up front, I think I\u2019m okay with that. :)<\/p>\n<p>I&#8217;m not yet sure which of these options I&#8217;ll be using in my own contest. Do you have any other WordPress or homegrown solutions that you know about? If so, I\u2019d love to hear about them in the comments. I\u2019ll be announcing more about this upcoming contest in the next week or thereabouts, so you might want to <a href=\"http:\/\/feeds.feedburner.com\/cssnewbie\">subscribe to my RSS feed now<\/a> so you don\u2019t miss any of the details!<\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been doing a bit of research lately on creating RSS-only content for my website \u2013 that is, content that shows up in my RSS feed and nowhere else. My searching has lead me to two very nice Wordpress plugins that should do the job that I need to do. I\u2019ve also come up with a way to accomplish the same feat using just HTML and CSS. [&#8230;]<\/p>\n<p><a class=\"more-link article\" href=\"https:\/\/cssdeck.com\/blog\/hiding-content-in-your-rss-feed\/\" title=\"Click to read 'Hiding Content in Your RSS Feed'\">Read Article<\/a><\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[168,197],"tags":[],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/189"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":0,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}