Custom XML

#589756
Viewing 6 replies - 1 through 6 (of 6 total)
  • Anonymous
    Rank Math free

    If there is also another way to include except the ones created automatically by Rank Math, some other URL’s the this is what i need.

    Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Please note that the custom-sitemap.php file should be created in your theme/child theme folder:
    https://rankmath.com/kb/custom-sitemaps/#num-1-create-a-new-file-in-the-child-theme

    To include the URLs in the sitemap, you can use this filter as well:
    https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-urls-in-sitemap

    Then, replace {$type} with the custom sitemap you have created.

    Hope that helps.

    Thank you.

    Anonymous
    Rank Math free

    Hello and thank you for your response. But if i dont use the child theme, i created the custom-sitemap.php in the theme folder. What i want is to include in the site map about 500 custom urls.

    Something like this would work?

    <?php
    add_action( ‘rank_math/sitemap/product_content’, function() {
    return ‘<url>
    <loc>https://&#8230;..</loc>
    <loc>https://&#8230;..</loc>
    <loc>https://&#8230;..</loc>
    <lastmod>2023-06-16T20:20:20+00:00</lastmod>
    </url>’;
    });

    Thank you

    Hello,

    For each item of the sitemap, you need to enclose it with <url>. Please refer to this example instead:

    add_action( 'rank_math/sitemap/custom_content', function() {
    	return '<url>
    			<loc>https://rankmath.com/some-custom-url/</loc>
    			<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    		</url>
    
    		<url>
    			<loc>https://rankmath.com/some-custom-url/</loc>
    			<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    		</url>
    	';
    });

    Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.

    Anonymous
    Rank Math free

    Thank you for your response,

    After i add those urls, where will i see that is included in the sitemap?

    Hello,

    Can you please follow these steps?
    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    That should fix the issue.
    
    If the issue persists, please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    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,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Custom XML’ is closed to new replies.