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
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: