Elliott\'s Moleskine

Avatar

A frayed Moleskine notebook with silky pages, optimized for digital delivery.

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:

  1. Download zip file from above
  2. Unzip the file to your drive
  3. Open the g2y.php file with an HTML editor such as Notepad
  4. Follow the brief instructions in that file to edit the necessary information
  5. Upload the g2y.php and yahoo.txt files to your server into the same directory as your Google XML sitemap is located
  6. 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)
  7. 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
  8. 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.


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



Tags:

31 Comments | Comment or Ping

  1. Theodor

    Thank you :)

  2. Thanks mate, just saw your post in the orginal google one, and one for yahoo thats great, cheers for making it.

  3. 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!

  4. 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.

  5. Great new layout btw!

  6. Thanks MA2T!

  7. 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 :)

  8. 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!

  9. 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. :)

  10. 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

  11. 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.

  12. Nuno

    I also get the same error:

    “cannot modify head information, headers already sentâ€? at line 31.

    What can we do?

  13. I looked for the solution and here it is:
    http://pt.php.net/header

    Put this on your .htaccess

    PHP_FLAG output_buffering on

  14. Hey! We hit 1000 downloads today…. pretty cool!

  15. 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!

  16. 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.

  17. 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?

  18. For URLs with & in them, it looks like your phpscript parses them into two separate lines.

  19. 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?

  20. 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

  21. 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

  22. True, my sites on other hosting works great with it. This host that has the problem is Dreamhost.

  23. 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/

  24. 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

  25. 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

  26. 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

  27. huy

    @srinivas, you have to delete the empty lines between the ?> after the output file variable and the next

  28. huy

    Cool tool, it would be cool if you can make it work with compressed sitemaps as well.

  29. Nice tool!!! I was looking for this long ago. Now i can simply convert it into the yahoo sitemap. Thanks a lot.

  30. Thanx Sir, salute to u for this innovation.

  31. aha i facing this problem, just check now

    Warning: Cannot modify header information - headers already sent by

Search My Book

Lijit Search