When I set a content type to "not in sitemap" it is still included in the sitemap, even after deleting cache and re-running cron.

thank you.

Comments

loze’s picture

Im not sure if this was the right way to do this.
but I emptied the db table xmlsitemap_node

changed xmlsitemap_node.module on line 38 to

if($row->priority > 0){
xmlsitemap_write_link($row, 'xmlsitemap_node');
}

re-ran cron
updated the cache files at /admin/settings/xmlsitemap/tools

and now the appropriate priorities are shown and the types marked "not in sitemap" are not included, as expected

not sure if this screws up something else, but it seems to be working as I need now.

Anonymous’s picture

I had this all fixed and working once upon a time about the 8th of May. Is BETA0 better?

alonpeer’s picture

Component: xmlsitemap_node.module » xmlsitemap.module
Priority: Normal » Critical
Status: Active » Needs review

Actually the correct patch, IMHO, is in xmlsitemap.module, xmlsitemap_output_link() (line 378):

function xmlsitemap_output_link($fp, $link) {
  if ($link->priority >= 0) {
    $template = <<<EOC
  <url>
    <loc>%loc</loc>
    <lastmod>%lastmod</lastmod>
    <changefreq>%changefreq</changefreq>
    <priority>%priority</priority>
  </url>

EOC;
    $trans = array(
      '%loc' => check_url($link->loc),
      '%lastmod' => gmdate(XMLSITEMAP_DATE_W3C, $link->changed),
      '%changefreq' => xmlsitemap_sitemap_frequency($link->changefreq),
      '%priority' => number_format($link->priority, 1),
    );
    $output = strtr($template, $trans);
    if ($fp) {
      fwrite($fp, $output);
    }
    else {
      print $output;
    }
  }
}

I added if ($link->priority >= 0) { }. It's more generic this way, and not specific to node pages.

dave reid’s picture

Anonymous’s picture

Status: Needs review » Fixed
bstrange’s picture

I have this problem as well. Tried deleting cached files and re-running cron but with no success. To be definative, which version should I be running that includes the patched line 378 above, or is that something that isn't incorporated into any build atm?

I really didn't want to go deleting database tables so if I can avoid that it would be preferrable.

Thanks in advance.

Anonymous’s picture

We've reset the code via #483844: Restore code to beta0. There is not an intra development upgrade path available. You must follow the instructions per #379854-128: The site map is not being populated.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.