Creating Custom Sitemap For The App

Sometimes we don’t use CPT’s to show the content.
suppose I have an app that shows job listing and a single job page
in this case job is not a post, it’s a lead in the database.
so for the job single page, wpseo is not gonna create a sitemap.
to create our custom site-map follow these steps:

  1. Create settings in app config(if not available).
  2. Create meta field ‘enable_sitemap’ in settings module and set value to yes, this will create a sitemap of that app.
  3. Create a new module in config named custom-sitemap and write your custom code in this module.

Sample custom-sitemap module:

Updated on Jun 19, 2021