Sitemap for SMF with Pretty URLs

Note: This is an archived post. Information may not be relevant now.

This is a PHP script that generates a sitemap file from an SMF installation with PrettyURLs mod, which is a must-have SEO package. The generated XML can be submitted to Google via Google Webmaster Tools.

The script is very much the itself. It has been modified to work with the latest version of SMF and PrettyURLs. The raw modifications can be seen in this commit

Native mysql_query is used instead of SMF's db_query (or the latest $smcFunc['db_query']). The database field names have been corrected to match the latest version of SMF. Support for search-engine friendly URLs for member profiles (e.g. has been added. Users may switch to not-pretty URLs (e.g.;u=2 ) by modifying the boolean value $sef_member_profile to FALSE at the start of the script. Also, the retrieval of pretty URLs for topics had to be corrected by adding the get_pretty_url_by_topic_id() method.

Tested against one live forum and it works fine, zero errors or warnings from Google Webmaster Tools.

Gist on Github:

Raw PHP File :