Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
kludge to make WordPress' Google Sitemap Generator exclude Page Links To pages linking to PDF files
function filterSitemapOptions($opts) {
global $wpdb;
// tell it to exclude any pages that are just page-links-to links to PDF files
$exclude = $wpdb->get_col("select post_id from $wpdb->postmeta where meta_key = '_links_to' and meta_value like '%.pdf'");
if (!empty($exclude)) {
$opts['sm_b_exclude'] = array_merge($opts['sm_b_exclude'], $exclude);
return $opts;
add_filter('option_sm_options', 'filterSitemapOptions');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.