Create a Sitemap From a b2evolution Database

If content is moved to a different domain, one way to create a sitemap for old content is to use a database query.

First, find out the blog id:

select * from evo_categories;

Next, use this query to extract all posts in the categories that are part of that blog:

select concat(’http://domain.com/’,date_format(post_datecreated,’%Y/%m/%d/’),post_urltitle) from evo_items__item join evo_categories on (evo_items__item.post_main_cat_ID=evo_categories.cat_ID) where evo_categories.cat_blog_ID=target_blog_id into outfile ’sitemap.txt’;

If you don’t have permissions to export into an outfile (.CSV file), you can just cut and pasted out of puTTY into NotePad or vi and then change the file to be a sitemap. Another option would be to pipe the MySQL output into a file and edit it.

The simplest sitemap is a list of URLs, with a different URL on each line. Remove any surrounding text or characters and then submit the sitemap to Google.