Quantcast
Channel: Web and Android Development Tips
Viewing all articles
Browse latest Browse all 23

SEO - Sitemaps and RSS Feeds for Google to find

$
0
0
SEO (Search Engine Optimization) is a very broad topic nowadays. There are many, many things a web developer must remember to do in order to optimize a site. 

If anyone is looking for a quick refresher or overview, this blog has the perfect cheat-sheet on SEO.

One of the things you should do to improve your search results is create a Sitemap file and "tell" Google and Bing where it is.


What's a Sitemap?

It's a simple XML file that defines the URLs on your site. For most web sites, using a simple Sitemap generator will do. But it gets more complicated if you have a Content Management System, like a blog.

A Sitemap can define where all the content is.. even dynamic blog posts

A blog allows you to post a new blog entry that has it's own link. It is important that these individual links be defined in a Sitemap file to be found by search engines. How do you dynamically define links in a content management system?

A solution for the savvy ASP.Net developer..

That is the problem I have recently ran into when I created my Joke Sharing Website.

My solution was to convert a dynamic page, an ASP.Net page to be exact, into outputting a XML instead of HTML. There are many tutorials for this type of thing if you wish to do it manually, but you can also download my source code (in C# and ASP.Net) and use the open source project instead. 

I've made it very, very easy for you!

Here's a code snippet, which you can use after you have referenced my project, to generate 10 new Url links:

        protected void Page_Load(object sender, EventArgs e)
        {
            using (DynamicSitemap sitemap = new DynamicSitemap(Response))
            {
                for (int i = 0; i < 10; i++)
                {
                    sitemap.WriteUrl("http://www.example.com/");
                }
            }
        }

That's it! The class I've written will take care of creating the XML sitemap file. This leaves you to focus on what's important - whatever you need to dynamically do (probably from a database) to make the Sitemap.

In the project, there is also an RSS Class to use that works the same way. The Sitemap and RSS protocols may seem simple, but they can quickly get complicated with extensions. I have handled alot of Google's Sitemap Protocols as well, which believe me, is a lot of typing you don't want to do.

For those of you not using ASP.Net

There are many other ways to dynamically generate a Sitemap and/or RSS Feed. If you are unable to do this in your choice of Web language (PHP, JSP, Python) then you can still automate the process with a script that runs periodically and creates the Sitemap file for you.

I have the Sitemap or RSS Feed file, what now?

After you're done creating a sitemap, you should place your generic one in the base directory named "sitemap.xml".
Note: If you use my open source project, you will not be able to name it sitemap.xml because you must use a .aspx extension.
You should also submit your Sitemap(s) and RSS Feed(s) using Google Webmaster Tools and Bing Webmaster Tools.

Viewing all articles
Browse latest Browse all 23

Trending Articles