Hello,
I apologize for the inconvenience you faced with the sitemap permalink for your custom post type. To address the issue of the incorrect URL structure in the Rank Math sitemap for your custom post type “car listings,” you can follow these steps:
-
Check Permalink Settings: Ensure that the permalink settings in WordPress are correctly configured to display the post title in the URL structure. You can adjust this by going to Settings > Permalinks in your WordPress dashboard.
-
Rank Math Settings: Verify the settings in Rank Math related to custom post types. You can navigate to Rank Math > Titles & Meta > Post Types and ensure that the correct variables are set to display the post title in the URL.
-
Flush Permalinks: After making any changes, remember to flush the permalinks by going to Settings > Permalinks and clicking on the “Save Changes” button. This action will refresh the permalink structure.
If the issue persists after following these steps, please reply to this ticket, and a human agent from our support team will assist you further.
Thank you for bringing this concern to our attention. We appreciate your patience.
Best regards.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
WordPress Permalink Structure & Changing Individual URLs » Rank Math
Why Isn’t My URL Included in the Sitemap? » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
Analyzing Your Site’s SEO with Rank Math’s SEO Analysis Tool
This is the rewrite rule i’ve applyed for the custom post type:
add_rewrite_rule( ‘^’.$listings_page.’/([^/]*)/([^/]*)/?([^/]*)/?’, ‘index.php?pagename=’ . $listings_page . ‘&ac_listing=yes&id=$matches[2]&extra=$matches[3]’, ‘top’ );
I’ve also tried with this one but again, it’s showing up a random page slug instead of the post slug:
add_rewrite_rule( ‘^’.$listings_page.’/([^/]*)/?([^/]*)/?’, ‘index.php?pagename=’ . $listings_page . ‘&ac_listing=yes&name=$matches[1]&extra=$matches[2]’, ‘top’ );
Thanks
Hello,
Thank you for your patience.
We’ve checked your sitemap, and the URL appears as it is:
Could you please confirm where are you seeing the link with the contact form in it?
Looking forward to helping you.
Hi,
thanks for getting back on this.
Yes, I confirm I’ve fixed the issue, it was related to this hook: add_filter( ‘post_type_link’), i was submitting the wrong parameter.
Thanks
Hello,
Thank you for the update.
We’re glad that you have already managed to resolve this issue.
If you have any other concerns, please don’t hesitate to contact us anytime to assist you further.
Looking forward to helping you.