Add custom URLs to WordPress’s XML sitemap

Sitemap Provider It’s possible to create a so called custom sitemap provider and register it with wp_register_sitemap_provider(). It’s helpful to look at the core setup, e.g. for the WP_Sitemaps_Posts provider and also the dev notes. Basic Example – Sitemap with custom URLs Here’s a very basic example that adds the wpse provider that extends WP_Sitemaps_Provider, … Read more

Exclude custom post_type in sitemap generation?

If you are using functions.php script to register custom post type, you should declare false to ‘has_archive’ => true,. function custom_post_type() { $labels = array( … ); $args = array( // you have to set it to False. ‘has_archive’ => false, ); register_post_type( ‘post_type’, $args ); } add_action( ‘init’, ‘custom_post_type’, 0 );

Uploading sitemap.xml

WordPress is set up in a way that mostly ignores existing files. If what you want is literally upload fixed sitemap.xml file you can just do that and upload it to the root of your site (using FTP, hosting control panel, or whatever). WordPress will just ignore it and it will be available at example.com/sitemap.xml … Read more

Is it safe to use ‘date_default_timezone_set’ in plugin file?

http://codex.wordpress.org/Function_Reference/get_gmt_from_date Replace all instances of get_the_date or the_date with echo get_gmt_from_date(get_the_date(‘Y-m-d H:i:s’)). That’s not a quick fix, it’s a way to fix your sitemaps. EDIT: WordPress SEO runs it’s raw dates from MySQL through a WP function called mysql2date, which in turn calls date_i18n. date_i18n happens to have a handy filter which you can tie … Read more

Does the ‘WordPress Order’ feature, within the WordPress Dashboard, have any impact on site architecture?

Short answer: No, it does not have any impact at all. Longer answer: The ‘Order’ field is a remnant from the early days of WordPress. Its only purpose is to order the pages in the admin for easier content management. Plus, people can use it to display a list of pages in their preferred order, … Read more

Why do I get a 404 for my sitemap index after installing Yoast? [closed]

Go to Admin > Settings > Permalinks and click save without altering anything “Sometimes resetting the permalink structure will quickly solve a 404 error from a recent change to your installation.” See http://kb.yoast.com/article/77-my-sitemap-index-is-giving-a-404-error-what-should-i-do for further details

How to consolidate all sitemaps in a multisite network?

WordPress multisite subdomains or suddirectories? I’m not sure if you’re getting the two confused. Multisite subdomains are basically fake subdomains that simply have a CNAME or A-Name record added in the DNS records. That said, and I believe one responder said this, you just need a sitemap for the root domain, and then you’ll have … Read more