iELLIOTT.com’s Google 2 Yahoo Sitemap Converter
NOTICE: This script will soon be obsolete because of an agreement between Yahoo, MSN, and Google that will use your existing Google Sitemap file as-is. See this article for more info.
The Problem:
Everywhere you turn there are great little products to create your Google compliant sitemap. Of course, Yahoo! then enters the game to let you upload a sitemap as well, but the problem is - it’s a totally different format!
Personally, I use the Google Sitemap Generator plugin for Wordpress. The plugin works in the background and automatically generates a new Google sitemap whenever you post to your site. You can even tell it to add static pages!! It works wonders. In fact, one of my sites now has almost 10,000 pages indexed - and I mostly attribute that to this plugin.
BUT… I’m having problems getting similar results in Yahoo. So, I figured out I needed a way to take my Google sitemap which is so beautifully generating itself all day long, and turn it into a Yahoo! sitemap. A Yahoo sitemap is simply a text file with a list of urls - each url being on a new line.
The Solution:
I had a PHP script written that looks at your existing Google sitemap XML file, and then turns it into a compliant Yahoo sitemap text file! Brilliant!
Honestly, I don’t know why there isn’t something like this already… but I looked high and low… and literally came up with zero results! So, hopefully this page comes as a welcome suprise to you!
I’m allowing this script to be downloaded and used absolutely free. If you appreciate the script though, I wouldn’t turn down a donation or at least a link from your site!
I provide no warranty or support. You’ll be on your own…
DOWNLOAD THE SCRIPT
Requirements:
This is a PHP script. You need PHP running on your server as well as the ability to setup a cron job. Of course, you would also need an existing script that is creating a Google XML sitemap for you, and a way to upload files to your web server.
Instructions:
- Download zip file from above
- Unzip the file to your drive
- Open the g2y.php file with an HTML editor such as Notepad
- Follow the brief instructions in that file to edit the necessary information
- Upload the g2y.php and yahoo.txt files to your server into the same directory as your Google XML sitemap is located
- CHMOD the yahoo.txt file to 777 (You can rename this file to whatever you wish as long as you correctly change the reference to the file in g2y.php)
- Setup the cron job. I have mine run once every night, thought you can run it as often as you like. I use the following line in my crontab file:
0 0 * * * wget -t 5 --delete-after- http://url.to/g2y.php - Enjoy! Link to me! Donate if you wish…
Feel free to leave comments below so I know what you think about the script. Thanks for stopping by.
-Elliott
NOTES:
You do NOT have to use cron for this. You could simply edit and upload the g2y.php file and the text file, CHMOD the text file, then run g2y.php from your browser. After you see it’s finished, open your text file url in your browser to make sure it looks right, then go to Yahoo Submit to submit your text file url location.

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Tags: Scripts












45 Comments | Comment or Ping
Theodor
Thank you :)
Nov 3rd, 2005
ma2t
Thanks mate, just saw your post in the orginal google one, and one for yahoo thats great, cheers for making it.
Nov 4th, 2005
Elliott
You’re welcome guys. The file’s been downloaded almost 200 times already in the past couple weeks… anyone else finding it useful? Comments! Comments!
Nov 21st, 2005
MA2T
Just came back to get the yahoo link lol.
Im using it on a smaller / newer site of mine and im hopeful it’s working, im sure it is.
Cheers again for it.
Nov 24th, 2005
MA2T
Great new layout btw!
Nov 24th, 2005
Elliott
Thanks MA2T!
Nov 26th, 2005
MA2T
Hey Elliott, I just noticed that the .txt file I submitted to yahoo is infact listed in yahoo. Im hoping it read the file rather than just listing it?, anything im doing wrong, or is Yahoo just adding it also?
Cheers :)
Dec 1st, 2005
Elliott
It doesn’t look like any of the text files I’ve submitted have actually been listed in Y!. However, I wouldn’t put it by them. As long as you submitted the URL of your text file at the Y! submit page, you should be fine and it should set those URLs in the file to be indexed.
Unfortunately, we have no way of knowing (like we do with Google Sitemaps) if the file gets checked at all… but that’s the risk we take to get more pages indexed I guess!
Dec 3rd, 2005
Brad D
Thanks for the script. It’s really easy to use and took me no more than 3 minutes to have a working yahoo.txt file to submit with.
As for your comment on the sitemap not being checked yet - it takes Yahoo ages to do anything, don’t get discouraged it will get checked. :)
Dec 6th, 2005
Monika
Thanks a lot!
since a week or so, I’m searching for something like this. Today I’ve said to me:Ok Monika you have to do it by yourself.;)
But as I’m searching for a css problem I’ll found your site and this script.
:-)
kindly regards.
Monika
Dec 16th, 2005
Chris
Thank you thank you thank you is all I can say! I’ve been trying to find something like this for a while.
By the way, I’m runing WP 2.0, and I’m using godaddy webhosting, and I get error “cannot modify head information, headers already sent” at line 31. Not sure if its a chmod issue, not sure if I even have access to that, but a little copy+paste does the trick.
Jan 17th, 2006
Nuno
I also get the same error:
âcannot modify head information, headers already sentâ? at line 31.
What can we do?
Mar 14th, 2006
Nuno Oliveira
I looked for the solution and here it is:
http://pt.php.net/header
Put this on your .htaccess
PHP_FLAG output_buffering on
Mar 14th, 2006
Elliott
Hey! We hit 1000 downloads today…. pretty cool!
Apr 19th, 2006
Marty Martin
In your crontab above, you have an extra dash after ‘–delete-after’ in there that causes the crontab to fail (at least for me).
You have-
0 0 * * * wget -t 5 –delete-after- http://url.to/g2y.php
Should be-
0 0 * * * wget -t 5 –delete-after http://url.to/g2y.php
Otherwise, great script, works brilliantly!
Apr 20th, 2006
JP
Thank you for the plugin and your work.
I’ve uploaded everything and it seems to work maually. However, I’m getting an email with
/bin/sh: 0: command not found
Anything i did wrong? Thank you for you time.
Jun 11th, 2006
Elliott
JP’s cron seems to be setup okay… (JP, you might want to try Marty’s suggestion above) - anyone know what might be up with his error?
Jun 11th, 2006
Chris
For URLs with & in them, it looks like your phpscript parses them into two separate lines.
Jul 7th, 2006
tony
Hi, was viewing this log, i used a tool that generated a ‘ror’ format sitemap, it said most search engines recognise it including google.
I submitted it to google, came back ok, i also submitted to yahoo, will it be recognised?
Aug 4th, 2006
Peter
I got this error in the txt file:
Time: Mon, 21 Aug 2006 13:23:44 +0000
————————————————————-
Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.heather/coxis/vistastyles.org/g2y.php on line 49
Warning: fopen(http://www.vistastyles.org/sitemap.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found in /home/.heather/coxis/vistastyles.org/g2y.php on line 49
————————————————————-
Total 0 URLS
Time: Mon, 21 Aug 2006 13:23:44 +0000
Aug 21st, 2006
Elliott
Peter,
Looks like you’ll need to contact your host about that - it’s some setting on the server that’s disabled and affecting the script from running.
-Elliott
Aug 21st, 2006
Peter
True, my sites on other hosting works great with it. This host that has the problem is Dreamhost.
Aug 21st, 2006
Stewart
Hi Elliott,
I too use Google Sitemaps plugin for WordPress 2.0 and I have added a plugin (Google Sitemaps - UTW Tag Addon) that neatly extended the Google Sitemaps plugin. My plugin has the ability to extract UltimateTagWarrior tags and append these into the Google Sitemap XML file when you execute the Google Sitemaps plugin.
Info on this WP plugin is at http://www.dicontas.co.uk/blog/google-sitemap-utw-tag-wordpress-plugin/
If you have two Google sitemaps, one for your web and one for your wordpress pages, I have created a PHP script to extract all the URLs from both these XML sitemaps (web & blog) and to update the urllist.txt and yahoo.txt which allows for both MSN and Yahoo search engines to learn about all yuor URL pages - but I believe that Yahoo has now moved over to using urllist.txt too.
This enhanced script was based upon, and modified, from your script on this page. I hope you dont mind! More info can be seen at http://www.dicontas.co.uk/blog/google-to-yahoo-msn-sitemaps-creator-tool-page/
Oct 2nd, 2006
Sergio Pinna
I looked for the solution and here it is:
http://pt.php.net/header
Put this on your .htaccess
PHP_FLAG output_buffering on
I’m tring it, but it don’t work. I’m sorry, but… where exactly i put
PHP_FLAG output_buffering on?My .htaccess looks like:
ErrorDocument 404 /index.php?error=404
# BEGIN WordPress
# Begin Plaintext WordPress plugin
etc...etc...etc...
Thnks for your help!
P.S. I’m sorry for my english :-P
Oct 8th, 2006
Mark Fresh
Brilliant script, thank you.
A couple of things, how do I stop it from line breaking on the txt file when it comes to a & (e.g. http://www.eastdulwichforum.co.uk/urllist.txt)
Yahoo say “the filename of the URL list file must be urllist.txt; for a compressed file the name must be urllist.txt.gz”
thanks again
Mark
Oct 23rd, 2006
srinivas
Hello,
iam using this plug-in but i got some problems,
i hope you will solve them.
1. iam getting cant modify header information,
so i used that tag in .htaccess,
now iam getting 500 internal server error,
i hope you will correct this and give me solution,
this is really great plugin, if we want to indexed in yahoo
Oct 30th, 2006
huy
@srinivas, you have to delete the empty lines between the ?> after the output file variable and the next
Nov 6th, 2006
huy
Cool tool, it would be cool if you can make it work with compressed sitemaps as well.
Nov 6th, 2006
GoScript
Nice tool!!! I was looking for this long ago. Now i can simply convert it into the yahoo sitemap. Thanks a lot.
Dec 26th, 2006
Vineet Kumar
Thanx Sir, salute to u for this innovation.
Jan 29th, 2008
Vineet Kumar
aha i facing this problem, just check now
Warning: Cannot modify header information - headers already sent by
Jan 29th, 2008