Hello friends,
I've been submitting my sitemap to google for a while now. However, since I have some link trading scripts, my sitemap tool (I'm using GoDaddy sitemap "tool") has indexed a bunch of ugly urls, all of them related to link trading scripts. It sounded stupid to submit these urls to google, but I didn't know of a tool that could rid me of this.
Until now, of course
I'm attaching a script that does this for me. It's written in php, and is supposed to run from command line. I called it cleanSitemap, even though it's a stupid name
If started without parameters, it will display usage instructions. Also, it takes care about some of the potential user errors like mistyping input file name and write errors.
However, if your input xml file is badly formatted, it will crash.
It also displays a small promotional message (only one line, I promise).
So, here is usage instructions:
USAGE: php cleanSitemap.php <input file> <output file> <bad str>
This script parses <input file>, skipping all the sitemap XML elements containing <bad str>,
writting only 'good' XML elements into sitemap.
Sample: php cleanSitemap.php sitemap.xml sitemap_clean.xml protect-x
I hope it helps!
Cheers
I've been submitting my sitemap to google for a while now. However, since I have some link trading scripts, my sitemap tool (I'm using GoDaddy sitemap "tool") has indexed a bunch of ugly urls, all of them related to link trading scripts. It sounded stupid to submit these urls to google, but I didn't know of a tool that could rid me of this.
Until now, of course
I'm attaching a script that does this for me. It's written in php, and is supposed to run from command line. I called it cleanSitemap, even though it's a stupid name
If started without parameters, it will display usage instructions. Also, it takes care about some of the potential user errors like mistyping input file name and write errors.
However, if your input xml file is badly formatted, it will crash.
It also displays a small promotional message (only one line, I promise).
So, here is usage instructions:
USAGE: php cleanSitemap.php <input file> <output file> <bad str>
This script parses <input file>, skipping all the sitemap XML elements containing <bad str>,
writting only 'good' XML elements into sitemap.
Sample: php cleanSitemap.php sitemap.xml sitemap_clean.xml protect-x
I hope it helps!
Cheers