Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RSS and WordPress

RSS and WordPress

How RSS and WordPress interact.

Jason Tucker

August 02, 2012
Tweet

More Decks by Jason Tucker

Other Decks in How-to & DIY

Transcript

  1. History of RSS Started out being called: RDF Site Summary

    Created by Netscape in 1999 First version in was 0.90, later Userland improved it O’Reilly and later Dave Winer (formerly of Userland) at Harvard University got involved in it, improved it more. 2 Wednesday, August 1, 12
  2. What is RSS? It’s a way to tell your readers

    new content is on your site. XML structured file format It is used all over the world to syndicate news articles and blog posts It’s a simple structure that can be read with simple scripting 3 Wednesday, August 1, 12
  3. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  4. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  5. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  6. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  7. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  8. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  9. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  10. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  11. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  12. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  13. I’ve seen this icon before RSS can be found on

    may sites you visit every day. 4 Wednesday, August 1, 12
  14. How is RSS used in WordPress? RSS is referenced in

    the <head> </head> block of the HTML using the <link> tag. <link rel="alternate" type="application/rss+xml" title="Test TUCKER.Professional Web Services - Feed" href="http://test.tucker.pro/feed/" /> <link rel="alternate" type="application/rss+xml" title="Test TUCKER.Professional Web Services - Comments Feed" href="http://test,tucker.pro/comments/feed/" /> 5 Wednesday, August 1, 12
  15. How is RSS used in WordPress? RSS is referenced in

    the <head> </head> block of the HTML using the <link> tag. <link rel="alternate" type="application/rss+xml" title="Test TUCKER.Professional Web Services - Feed" href="http://test.tucker.pro/feed/" /> <link rel="alternate" type="application/rss+xml" title="Test TUCKER.Professional Web Services - Comments Feed" href="http://test.tucker.pro/comments/feed/" /> 6 Wednesday, August 1, 12
  16. RSS URLs for Posts using various feed formats http://example.com/?feed=rss http://example.com/?feed=rss2

    http://example.com/?feed=rdf http://example.com/?feed=atom http://example.com/feed/ http://example.com/feed/rss/ http://example.com/feed/rss2/ http://example.com/feed/rdf/ http://example.com/feed/atom/ 7 Wednesday, August 1, 12
  17. Structure of RSS <rss 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/" version="2.0"> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self" type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25 Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ <p>Welcome to <a href="http://test.tucker.pro/">Test TUCKER.PROfessional Web Services Sites</a>. This is your first post. Edit or delete it, then start blogging!</p> ]]> </content:encoded> <wfw:commentRss>http://test.tucker.pro/hello-world/feed/</wfw:commentRss> <slash:comments>1</slash:comments> 12 Wednesday, August 1, 12
  18. Structure of RSS - Channel <rss> <channel> <title>Test Website</title> <atom:link

    href="http://test.tucker.pro/feed/" rel="self" type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</ sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</ generator> <item> </item> </channel> title link description lastBuildDate language sy:updatePeriod sy:updateFrequency generator item 13 Wednesday, August 1, 12
  19. Channel - Title <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 14 Wednesday, August 1, 12
  20. Channel - Title <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 15 Wednesday, August 1, 12
  21. Channel - Link <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 16 Wednesday, August 1, 12
  22. Channel - Link <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 17 Wednesday, August 1, 12
  23. Channel - Description <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 18 Wednesday, August 1, 12
  24. Channel - Description <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 19 Wednesday, August 1, 12
  25. Structure - Generator <rss> <channel> <title>Test Website</title> <atom:link href="http://test.tucker.pro/feed/" rel="self"

    type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 20 Wednesday, August 1, 12
  26. Structure of RSS - Item <rss> <channel> <title>Test Website</title> <atom:link

    href="http://test.tucker.pro/feed/" rel="self" type="application/rss+xml"/> <link>http://test.tucker.pro</link> <description>Test TUCKER.PROfessional Web Services site</description> <lastBuildDate>Wed, 25 Apr 2012 19:32:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item> </item> </channel> </rss> 21 Wednesday, August 1, 12
  27. Structure of RSS - Item <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</

    comments> <pubDate>Wed, 25 Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ <p>Welcome to <a href="http://test.tucker.pro/">Test TUCKER.PROfessional Web Services Sites</a>. This is your first post. Edit or delete it, then start blogging!</p> ]]> </content:encoded> <wfw:commentRss>http://test.tucker.pro/hello-world/feed/</ wfw:commentRss> <slash:comments>1</slash:comments> </item> title link comments pubDate dc:creatory category guid description content:encoded wfw:commentRss 22 Wednesday, August 1, 12
  28. Item - Title <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 23 Wednesday, August 1, 12
  29. Item - Title <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 24 Wednesday, August 1, 12
  30. Item - Title <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 25 Wednesday, August 1, 12
  31. Item - Title <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 26 Wednesday, August 1, 12
  32. Item - Title <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 27 Wednesday, August 1, 12
  33. Item - Comments <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 28 Wednesday, August 1, 12
  34. Item - Comments <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 29 Wednesday, August 1, 12
  35. Item - pubDate <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 30 Wednesday, August 1, 12
  36. Item - pubDate <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 31 Wednesday, August 1, 12
  37. Item - DC:Creator <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 32 Wednesday, August 1, 12
  38. Item - Category <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 33 Wednesday, August 1, 12
  39. Item - Category <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 34 Wednesday, August 1, 12
  40. Item - Description <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 35 Wednesday, August 1, 12
  41. Item - Description <item> <title>Hello world!</title> <link>http://test.tucker.pro/hello-world/</link> <comments>http://test.tucker.pro/hello-world/#comments</comments> <pubDate>Wed, 25

    Apr 2012 19:06:37 +0000</pubDate> <dc:creator>jason</dc:creator> <category> <![CDATA[ Uncategorized ]]> </category> <guid isPermaLink="false">http://test.tucker.pro/?p=1</guid> <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ 36 Wednesday, August 1, 12
  42. Item - content:encoded <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web

    Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ <p>Welcome to <a href="http://test.tucker.pro/">Test TUCKER.PROfessional Web Services Sites</a>. This is your first post. Edit or delete it, then start blogging!</p> ]]> </content:encoded> <wfw:commentRss>http://test.tucker.pro/hello-world/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> 37 Wednesday, August 1, 12
  43. Item - content:encoded <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web

    Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ <p>Welcome to <a href="http://test.tucker.pro/">Test TUCKER.PROfessional Web Services Sites</a>. This is your first post. Edit or delete it, then start blogging!</p> ]]> </content:encoded> <wfw:commentRss>http://test.tucker.pro/hello-world/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> 38 Wednesday, August 1, 12
  44. Item - wfw:commentRss <description> <![CDATA[ Welcome to Test TUCKER.PROfessional Web

    Services Sites. This is your first post. Edit or delete it, then start blogging! ]]> </description> <content:encoded> <![CDATA[ <p>Welcome to <a href="http://test.tucker.pro/">Test TUCKER.PROfessional Web Services Sites</a>. This is your first post. Edit or delete it, then start blogging!</p> ]]> </content:encoded> <wfw:commentRss>http://test.tucker.pro/hello-world/feed/ </wfw:commentRss> <slash:comments>1</slash:comments> </item> 39 Wednesday, August 1, 12
  45. Google Reader If you have a Google account you already

    have access to it It’s web based and easy to use Lots of applications can connect to Google reader. http://reader.google.com 41 Wednesday, August 1, 12
  46. NetNewsWire Works on Mac, iPhone and iPad Native Application Syncs

    with Google Reader but not required Free, Ad Supported http://netnewswireapp.com/ 42 Wednesday, August 1, 12
  47. What about the ads on my website? I’m going to

    lose money!?! 49 Wednesday, August 1, 12
  48. Automatically, Ad plugins can add banner ads to your RSS

    feed. AdSense WordPress Plugin Easy AdSense Lite Simple Ads Manager 50 Wednesday, August 1, 12
  49. Automatically, Ad plugins can add banner ads to your RSS

    feed. AdSense WordPress Plugin Easy AdSense Lite Simple Ads Manager 50 Wednesday, August 1, 12
  50. Use any ad manager plugin to insert ads into your

    RSS feed. 51 Wednesday, August 1, 12
  51. WordPress Functions for RSS the_content_rss() Display the post content for

    the feed. the_excerpt_rss() Display the post excerpt for the feed. 52 Wednesday, August 1, 12
  52. Using AdSanity to display an ad in a RSS feed

    <?php function insertAds($content) { $content = $content."<hr />" $content .= echo do_shortcode('[adsanity]'); return $content; } add_filter('the_excerpt_rss', 'insertAds'); add_filter('the_content_rss', 'insertAds'); ?> 53 Wednesday, August 1, 12