How to generate/update a XML sitemap without plugins?

The following code works right off the bat. Your sitemap will show up on: https://your-website-name.com/sitemap.xml Every time you create or update a page, post or custom post type it will show. Make sure to add the name of your custom post type: add_action( ‘publish_post’, ‘ow_create_sitemap’ ); add_action( ‘publish_page’, ‘ow_create_sitemap’ ); add_action( ‘save_post’, ‘ow_create_sitemap’ ); function … Read more