Title: Google Sitemap
Last modified: August 18, 2016

---

# Google Sitemap

 *  [dyn4mik3](https://wordpress.org/support/users/dyn4mik3/)
 * (@dyn4mik3)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/)
 * I whipped up a php script to generate a [Google Sitemap from all posts](http://www.socialpatterns.com/search-engine-optimization/google-sitemaps-with-wordpress/).
   I’m not sure if it will work on all WordPress sites since I only have access 
   to mine.
 * If anyone can improve on this please do!

Viewing 15 replies - 1 through 15 (of 55 total)

1 [2](https://wordpress.org/support/topic/google-sitemap/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/google-sitemap/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/google-sitemap/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/google-sitemap/page/2/?output_format=md)

 *  [Ozh](https://wordpress.org/support/users/ozh/)
 * (@ozh)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214492)
 * Nice ! I was to start a thread on this topic and I saw you were quicker than 
   me 🙂
 * Your script works fine, at least with all my (tests and real) blogs. I already
   have a few suggestions that I posted on your site. I’m sure Google Sitemap will
   be largely adopted by the WP community and there is a lot of space left for improvements.
   Your script is a very nice start on this matter. Thanks again 🙂
 *  [raianoat](https://wordpress.org/support/users/raianoat/)
 * (@raianoat)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214606)
 * Great job! I was hoping that somebody would do this.
 * Thanks!
    Alex
 *  [Dean Sas](https://wordpress.org/support/users/dsas/)
 * (@dsas)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214682)
 * I’ve just came here to see if anyone had done this so I could get it, thanks 
   dyn4mik3.
 * I’ve modified your code to include [categories in sitemaps too](http://www.deansas.org/archives/2005/06/04/sitemaps/)
 *  [m4c3w4n](https://wordpress.org/support/users/m4c3w4n/)
 * (@m4c3w4n)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214750)
 * dsas, I modded it further to combine
    [categories & gzipping](http://www.macewan.org/sitemap.txt)
 *  [rshupe](https://wordpress.org/support/users/rshupe/)
 * (@rshupe)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214756)
 * I ended up with a very similar solution to achive [Google Sitemaps for WordPress](http://www.shupe.ca/articles/website/687).
   The only addition functionality wise is that mine adds the <lastmod> element 
   to the category output.
 *  [johanvanderwijk](https://wordpress.org/support/users/johanvanderwijk/)
 * (@johanvanderwijk)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214766)
 * To also include the static pages to the XML output, I modified the query from
   the first script in this thread to this:
 * `SELECT * FROM $wpdb->posts WHERE post_status = 'publish' OR post_status = 'static'
   ORDER by post_modified DESC`
 * Works perfectly 🙂
 *  [elyonline](https://wordpress.org/support/users/elyonline/)
 * (@elyonline)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214799)
 * so do you just add the PHP file to the root of WP?
 * Thanks
 *  [johanvanderwijk](https://wordpress.org/support/users/johanvanderwijk/)
 * (@johanvanderwijk)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214819)
 * Yes, you can just add the PHP file to the root of WP and then give this as the
   location in the “Enter your Sitemap URL below” form.
    Note that the example is
   in the form of [http://www.google.com/sitemap.xml](http://www.google.com/sitemap.xml),
   but you will have to use something like [http://www.google.com/sitemap.php](http://www.google.com/sitemap.php)(
   php filename extension).
 *  [elyonline](https://wordpress.org/support/users/elyonline/)
 * (@elyonline)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214822)
 * OK thanks a lot 🙂
 *  [raianoat](https://wordpress.org/support/users/raianoat/)
 * (@raianoat)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214839)
 * Works great! Just added mine:
 * [http://www.raianofamily.net/google_sitemap.php](http://www.raianofamily.net/google_sitemap.php)
 * [http://www.tivoblog.com/google_sitemap.php](http://www.tivoblog.com/google_sitemap.php)
 *  [angsuman](https://wordpress.org/support/users/angsuman/)
 * (@angsuman)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-214867)
 * How about creating a plugin 🙂
 *  [theodorramisch](https://wordpress.org/support/users/theodorramisch/)
 * (@theodorramisch)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-215014)
 * Have a look at [arnebrachhold.de](http://www.arnebrachhold.de/2005/06/05/wordpress-sitemap-generator-for-google).
   Supports categories, archives, static pages and has a priority calculation for
   posts.
 *  [Lorelle](https://wordpress.org/support/users/lorelle/)
 * (@lorelle)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-215015)
 * Wow, this is amazingly fast. I tested two of the mentioned php files and I had
   two different results, but all that was involved was copying the code from the
   screen and pasting it into a text file which I saved as a php file and uploaded
   to my root directory or just uploading the a php file to the root directory (
   came ready to go). I then viewed the saved file name in my browser to compare,
   they looked fine, and I submitted both to Google’s Site Maps link.
 * Took under five minutes, including reading the instructions and all.
 * Very quick. Thanks to all who have written scripts to make this easy for us.
 *  [sidney440](https://wordpress.org/support/users/sidney440/)
 * (@sidney440)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-215024)
 * Well, after some time, I finally somehow merged both plugins (Arne Brachhold’s
   and Michael Nguyen’s) so that all the best things are included ;-).
    This includes
   configurability, gzip compression, pages, and only generating when necessary.
   See [http://sidney.ws4f.us/2005/06/04/keeping-pace-with-google](http://sidney.ws4f.us/2005/06/04/keeping-pace-with-google)
 * Sid
 *  [kickass](https://wordpress.org/support/users/kickass/)
 * (@kickass)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/google-sitemap/#post-215025)
 * I think this thread should be either stickeyed or put in the Codex, folks.

Viewing 15 replies - 1 through 15 (of 55 total)

1 [2](https://wordpress.org/support/topic/google-sitemap/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/google-sitemap/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/google-sitemap/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/google-sitemap/page/2/?output_format=md)

The topic ‘Google Sitemap’ is closed to new replies.

## Tags

 * [sitemap](https://wordpress.org/support/topic-tag/sitemap/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 55 replies
 * 36 participants
 * Last reply from: [bolonki](https://wordpress.org/support/users/bolonki/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/google-sitemap/page/4/#post-215296)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
