Google site map


Time to write another XML file with php. Google site map. Google needs a sitemap to complete a more efficient index of your website now. – there is no longer an “add URL” button. Now there is “submit a site map”. It doesn’t respond straight away – but it does register the links contained in a formatted XML file.


Watch your $DBH = new PDO($hostDb, $user, $password);


But anyway: the format of the file is then this :

<?xml version="1.0" encoding="UTF-8"?>
  <urlset xmlns="">


Create the time format once more:

echo date(‘c’, strtotime($result [“post_modified”]));

‘c’ prints a lot of things, but this as well as ‘c’

2019-05-18T23:22:52-04:00 is directly from the MySQL entry. – ideal. but no different than someone else’s problems.

$ids = array();
while($row = $PTH->fetch()) {                 
$ids[] = $row;     }     
foreach ($ids as list($a)) {  
       /// whatever           

If you make any mistakes … I wouldn’t be sure what to look for when selecting a plugin – because they have more complexity than functionality.

To view the full working example try: view-source:

Previous articleRear Brake(s)
Next articleMeghan
Thank you for visiting WEEDBOX News. Michael Kearney writes detailed technical instruction(s) - and news articles for - try the search icon. Michael Kearney has over 25 years of computer experience. already thought about it - sign-up and get a free shell at call me at +1 (571) 662-1795 or email


Please enter your comment!
Please enter your name here