• Resolved pyoil

    (@pyoil)


    I have a [year] short code that displays correctly as 2023 in my site and in the SERP. However it doesn’t work correctly in the HTML sitemap. All I see is [year] and not 2023.

    How do I make sure the [year] executes in the HTML sitemap as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @pyoil,

    Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.

    You can choose the SEO Titles option from Item Titles in HTML sitemap settings and use the %currentyear% variable instead of the [currentyear] Shortcode in your SEO Titles to show the current year. After that, the year should be shown in the HTML sitemap perfectly.

    Let us know how it goes. Looking forward to helping you.

    Thread Starter pyoil

    (@pyoil)

    There are other short codes that I have in my title other than the [year] shortcode. How can I add a filter to ensure that shortcodes work in the sitemap.

    Can I do something like the below:

    
    add_filter('rank_math/sitemap/html_sitemap/title', function ($title) {
        return do_shortcode( $title );}
    );
    Thread Starter pyoil

    (@pyoil)

    Any help on this is appreciated

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @pyoil

    We don’t have any filters for the HTML sitemaps and only use the replace_vars() helper function, which parses the variables such as %currentyear%

    Sorry to disappoint, but that feature is unfortunately not available at this time.

    With that being said, there are existing feature requests, so we’ve added your vote to our internal suggestions lists. We’ll be sure to let you know if your suggestions are something we can introduce.

    If there is anything else we can help you with, please let us know.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcodes do not work in HTML Sitemap’ is closed to new replies.