Quantcast
Channel: Issues for XML sitemap
Viewing all articles
Browse latest Browse all 1238

Exclude a single node programmatically

$
0
0

I create several nodes in my manifest and there are a few that I don't want in my sitemap.

I could not find a function that worked for me so I wrote the following function:

function _exclude_from_sitemap($nid) {
return db_update('xmlsitemap')
->fields(array(
'status' => 0,
'status_override' => 1,
))
->condition('loc', 'node/'.$nid)
->execute();
}

Is there another (better) way?


Viewing all articles
Browse latest Browse all 1238

Trending Articles