Using a Shortcode to Display Your HTML Sitemap

All in One SEO has a shortcode which you can use to display your HTML Sitemap anywhere on your site.

This method can be used within the Classic Editor or Block Editor in WordPress, or with any page builder.

To learn about setting up the HTML Sitemap, check out our article on How to Create an HTML Sitemap here.

HTML Sitemap Shortcode

The main shortcode to use to display the HTML Sitemap is:

[aioseo_html_sitemap]

Shortcode Options

There are also some attributes you can use to customize what is displayed.

You can see the shortcode by clicking on Shortcode in the Display HTML Sitemap section of the HTML Sitemap settings.

Shortcode option in the Display HTML Sitemap section

You can see all of the attributes by clicking on the Advanced Settings link next to the shortcode.

Advanced Settings link next to the shortcode in HTML Sitemap settings

The attributes for the shortcode are:

  • post_types – Use this to specify which post types you want displayed in the sitemap. You can list multiple post types separated by a comma. Make sure you use the slug for each post type, i.e. post, page
  • taxonomies – Use this to specify which taxonomies you want displayed in the sitemap. You can list multiple taxonomies separated by a comma. Make sure you use the slug for each taxonomy, i.e. category, post_tag
  • label_tag – Use this to specify the HTML tag you want to use for the labels above each section in the HTML Sitemap. The default is H4
  • show_label – Use this to control whether labels are displayed above each section in the HTML Sitemap. The values are true or false, and the default is true
  • publication_date – Use this to control whether the date your content was published is displayed next to each content item in the HTML sitemap. The values are true or false, and the default is true. See the documentation here for more details
  • archives – Use this to control whether a compact archive is displayed instead of the HTML Sitemap. The values are true or false, and the default is true. See the documentation here for more details
  • order – Use this to control the direction in which content is listed in the HTML Sitemap. The values are ASC or DESC and the default is ASC (ascending). See the documentation here for more details
  • order_by – Use this to control the order in which content is listed in the HTML Sitemap. The values are publish_date, last_updated, alphabetical or id and the default is publish_date (Publish Date). See the documentation here for more details

Here's an example of how to use these attributes:

[aioseo_html_sitemap post_types="post,page" taxonomies="category,post_tag" label_tag="h2" show_label="true" publication_date="true" archives="false" order="ASC" order_by="alphabetical"]