How to add App URL to sitemap

#60335
Viewing 9 replies - 1 through 9 (of 9 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    First, you had to properly format the PHP code since it had errors, after that, the string to be added needs the date (I added that date but you can change it).
    Finally, you need to replace the ($type) with ‘post’ or ‘page’, depending on what sitemap you want it added. I set it as page, to add it to the page sitemap.

    You can read more about this filter here: https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-urls-in-sitemap

    /**
    * Filter to add extra URLs to the XML sitemap by type.
    *
    * Only runs for the first page, not on all.
    *
    */
    add_action( β€˜rank_math/sitemap/page_content’, function() {
       return '         https://www.blogvwant.com/IconVwant/home.php
             2020-02-20T20:20:20+00:00     
    '
    });

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Thanks for the quick reply.
    I have placed the below code. Still, page sitemap doesn’t’ contain the mentioned page.
    Will I have to do anything else?

    /**
     Filter to add extra URLs to the XML sitemap by type.
     *
     Only runs for the first page, not on all.
     *
     @param string $content String content to add, defaults to empty.
     */
     add_action( 'rank_math/sitemap/page_content', function() {
     return '         https://www.blogvwant.com/IconVwant/home.php/
             2020-06-10T20:20:20+00:00     
    ';
     });

    Hello,

    The data must be in an XML format. Please replace it with the following code:

    
    add_action( 'rank_math/sitemap/page_content', function() {
    	return '<url>
    		<loc>https://www.blogvwant.com/IconVwant/home.php/</loc>
    		<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    	</url>';
    });
    

    I hope that helps.

    Now placed as you mentioned. But still, it does not appear in the sitemap.

    /**
     Filter to add extra URLs to the XML sitemap by type.
     *
     Only runs for the first page, not on all.
     *
     @param string $content String content to add, defaults to empty.
     */
     add_action( 'rank_math/sitemap/page_content', function() {
    	return '<url>
    		<loc>https://www.blogvwant.com/IconVwant/home.php/</loc>
    		<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    	</url>';
    });

    Hello,

    Thank you for contacting Rank Math today.
    ​​​​​​
    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Alberto
    Rank Math business

    Hello,

    I have checked it but it seems it is already added to the Sitemap as I show you in the screencast I added to the Sensitive Data section. Could you check it?

    Looking forward to help you.

    Thanks.
    Now I am seeing it.
    Did you do anything?
    Because I did not see it earlier.

    Alberto
    Rank Math business

    Hello,

    I just resaved the permalinks since it forces Rank Math to regenerate the sitemaps instead of waiting for the next Cron job.

    Also, we are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this ticket.