permalinks site map - hidden records

8 posts by 4 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 7, 2015   (RSS)

By Toledoh - May 14, 2015

Hi All,

I use the attached to create a sitemap.xml.php for my sites - which seems to work pretty well.  However I noticed today that the permalinks table isn't updated if records are hidden.  This therefore creates warnings in google webmaster tools.

Can you think of any way to action this?

Cheers,

Tim (toledoh.com.au)
Attachments:

sitemap.xml.php 2K

By Damon - May 15, 2015

Hi Tim,

Did Jerry's suggestion work for you?

If not, can you send me a link to the actual URL to the sitemap (reply here or email support@interactivetools.com) and details about the warnings in webmaster tools.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Toledoh - May 15, 2015

Hi Jerry / Damon,

Yes thanks - this works - no warning now in webmaster tools!

Reading more, I think both replaced permalinks (where $record['old']) and hidden records (where $record[hidden])  should be removed from the sitemap.

I should also set up something in the pages to identify more important pages, and those pages that change more frequently (but will save that for another time)

<?php foreach ($_permalinksRecords as $record): ?>
<?php if (!$record['old']): ?>
<?php if (!$record['hidden']): ?>
<url>

<loc>http://<?php echo $_SERVER['HTTP_HOST']; ?><?php echo $record['_link'] ?></loc>

<lastmod><?php echo date('Y-m-d', strtotime($record['updatedDate'])) ?></lastmod>

<changefreq>weekly</changefreq>

<priority>0.5</priority>

</url>
<?php endif ?>
<?php endif ?>
<?php endforeach ?>

Cheers,

Tim (toledoh.com.au)

By Codee - July 7, 2015

Hey Tim,

Just caught this post...so your site maps are developed ONLY via permalinks and not by virtue of all outputted .php pages (created by CMS)?

By Toledoh - July 7, 2015

Yep - really just an output of the permalinks table.  Seems to work fine for me, but I'm not expect here...

Cheers,

Tim (toledoh.com.au)

By Codee - July 7, 2015

Cool...so...do you have an automated method for creating the permalinks pages or are you manually doing every single page? Thanks.

By Toledoh - July 7, 2015

With most of my sites, I structure the site using a categories section - which in turn drives the navigation and the permalinks, then there's just some pages that may need manual additions.  Other sections that are more complex - shopping pages, blogs etc, are all multi-sections, so again the permalinks are automated.

Cheers,

Tim (toledoh.com.au)