Home arrow PHP arrow Page 4 - Using PHP to Generate a Customized Google XML Sitemap

Implementation Guide - PHP

Submitting XML sitemaps to Google Webmaster Tools is an important webmaster activity. Google recommends using it to help it find new content in your website which otherwise cannot be crawled by Googlebot. This is particularly helpful if you have a fairly large website. In this article, you'll learn how to generate such a sitemap with PHP.

TABLE OF CONTENTS:
  1. Using PHP to Generate a Customized Google XML Sitemap
  2. The Web Form's HTML Code
  3. The PHP Server Side Script
  4. Implementation Guide
By: Codex-M
Rating: starstarstarstarstar / 4
June 16, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
  

The SEO Chat article Create a Customized Google XML Sitemap discusses the details for how to implement this web application.

Since this is a customized XML sitemap generator, careful attention must be given to ensure three things. First, you need to make sure that the URLs entered in the web form are arranged from the most important (e.g home page) to least important (e.g privacy policy).

See the screen shot below for a clear illustration.

Second, you need to use entity escape codes for the characters discussed on this page. You need to apply escape codes before pasting those entire URL list into the form.  

Third, you need to simply copy and paste the result on the web application output to a blank text file and save it as sitemap.xml

Finally, using your FTP to upload it to the root directory, you can then submit that sitemap to Google webmaster tools.

Note: You can download the entire sample web application as a zip file. 

A complete working web application can also be found. 



 
 
>>> More PHP Articles          >>> More By Codex-M
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap

Dev Shed Tutorial Topics: