How to add custom tags to RSS feed so that it is treated as a valid feed?

When you are developing rss feed for your project, majorly developer use custom nodes instead of default nodes from predefined namespace.
When developer validate the feed having custom nodes will not be validated and thrown an error to resolve.
So how to add some custom tags to RSS feed so that it is treated as a valid feed.

The right way to define your own elements is to create your own namespace – since you control the namespace, nobody but you can say that your elements are “wrong” in that namespace.

This requires only three steps:
Step 1:
Pick a URI that you control to be the namespace identifier, e.g. http://website.com/custom-rss-extensions/.
You don’t actually have to put anything particular at this URL, although a page explaining why you’ve done it might be useful for anyone curious who comes across it in your feed.

Step 2:
Assign an alias at the top of the feed to that namespace, along with all the existing ones, e.g. xmlns:webname=”http://website.com/custom-rss-extensions/”

Step 3:
Prefix all your elements (and attributes) with that custom namespace alias
Example: custom Data

That’s it.

Leave a Comment

Your email address will not be published. Required fields are marked *