RSS Post Importer - Advanced - Extracting Specific XML Tags


Extracting Specific XML Tags

Back to User Guides

When setting up feeds with the RSS Post Importer, the Add New XML Tag button can be used to capture specific tags into new shortcodes. This guide will explain this advanced feature in detail.

Adding new XML tag - RSS Feed Importer WordPress Plugin
Adding new XML tag

Table of Contents

  1. Step 1) Identifying the Tag
  2. Step 2) Choosing the Namespace
  3. Step 3) Add the Shortcode to the Post Template

Step 1) Identifying the Tag

a) Find the Tag Where The Desired Content is Located

Let's consider the following example:

You would like to extract the contents Itunes Summary <itunes:summary> and Date of Publication <pubDate>. 

Identifying the Tag - RSS Importer WordPress
Identifying the Tag

Restriction

It's not possible to:

  1. Get tags inside another tag.
  2. Get tag content if it is a complex of tags (has tags inside).

Note that <itunes:summary> has a prefix before the ":" ("itunes") and <pubDate> doesn't have any prefix. This takes us to the next step.


Step 2) Choosing The Namespace

Now it's time to add the tags, and for that, we need to know the namespace of each. Namespace refers to the way the elements are written down and organized.

The end result should be something like this:

Examples of custom XML tags - WordPress RSS Multi Importer Plugin
Examples of custom XML tags

a) Finding out the Namespace and Tag Name

There are simple rules, depending on the existence of a prefix:

  • Tag has prefix 
    • Namespace will be the prefix. Example: <itunes:summary> â†’ itunes is the prefix, so it's the Namespace.
    • Tag Name will be the remaining of the word. Example: <itunes:summary> â†’ "summary" is the Tag Name.
  • Tag doesn't have prefix
    • Namespace will be RSS 2.0 - Blank. Example: <pubDate> â†’ RSS 2.0 is the Namespace.
    • Tag Name will be the whole word. Example: <pubDate> â†’ Tag Name is the whole tag, "pubDate".
List of Namespaces

By adding the guid tag to the Add New XML Tag option, the plugin generates a shortcode for each. In this case,   [rss_feed_item_pubdate]  and [rss_feed_item_summary] . This takes us to the next step.


Step 3) Add the Shortcode to the Post Template

You should then add this shortcode to the post template (learn more: RSS Post Importer - Set Up - 4) How the Posts Are Displayed (Post Template)).

Adding shortcodes to the post template - RSS Feeds Importer Plugin
Adding shortcodes to the post template

In this specific case, the shortcodes would produce this in the Front-End:

[rss_feed_item_summary]

Former PGA Tour pro and Jungle Legend Steve Elkington joins The Jim Rome Podcast for Episode 76. Elk Previos the Masters, tells some Colin Montgomery stories, talks Tigere's win in 1997 and his chances this weekend, Phil Mickelson, and the direction Jordan Spieth and Justin Thomas are trending.

[rss_feed_item_pubdate]

Tue, 09 Apr 2019 20:37:25 + 0000


More information about the RSS Post Importer plugin for WordPress

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.