• Resolved gerryj

    (@gerryj)


    Hello,

    I’m currently trying to remove pages from the sitemap of a no longer existing translation via WPML.
    I already tried regenerating the Sitemap.xml.
    I deleted the translated pages from the database.

    Is there any particular way I could remove no longer existing translation/pages from the sitemap.xml?

    Regards
    Gerry

Viewing 15 replies - 1 through 15 (of 16 total)
  • @gerryj , I have never worked a site with WPML but this is how I handle removing old deleted posts/pages from reflecting on Yoast xml sitemap.

    Add similar to functions.php ….

    add_filter( ‘wpseo_exclude_from_sitemap_by_post_ids’, function () {
    return array( 27008, 27010, 27012, 27014, 27016, 27018, 27020, 27022, 27024, 27026, 27028, 27030, 27032, 27034, 27036, 27038, 27040, 27042, 27044, 27046, 27048, 27050, 27052, 27054, 27056, 27058, 27060, 27062, 27064, 22346 );
    } );

    Thread Starter gerryj

    (@gerryj)

    @shirtguy72 This solution with the filter would work theoretically but there is one big problem. None of these pages exist anymore. They all were deleted when we removed the language So I don’t know any of the IDs Actually going to these pages just returns a 404 errors.

    I found my deleted posts IDs by digging into my database.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello Gerry,

    Thanks for reaching out regarding your deleted translated pages. You did mention that these pages now throw 404 errors. With time, the pages will no longer be there or even show in search result pages.

    Hope that helps.

    Thread Starter gerryj

    (@gerryj)

    @shirtguy72 I already deleted all the remnants from the DB.

    Hello Maybellyne,

    ok, how long do I need to wait for them to be removed automatically?

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @gerryj

    We would expect that any pages that load as a 404 shouldn’t be appearing in the Yoast SEO generated sitemap – https://developer.yoast.com/features/xml-sitemaps/functional-specification/#exclusions–empty-sitemaps

    Would it be possible for you to provide us with some more information such as a link to your sitemap and those URLs that are still being listed?

    Thread Starter gerryj

    (@gerryj)

    Hi @mikes41720

    sure I can give you the links.
    https://poc.easy-software.com/sitemap_index.xml

    https://poc.easy-software.com/post-sitemap1.xml
    Here you can see Turkish links even tho these pages no longer exist.
    https://poc.easy-software.com/home-office-calismanin-anahtari-kagitsiz-ve-akilli-surecler/

    The website currently has password protection because it is still in development.
    How can I give the credentials without showing them to anyone?

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @gerryj

    We aren’t able to ask for credentials to log in to your website, as that is against the forum guidelines.

    We’re checking on your post sitemap (https://poc.easy-software.com/post-sitemap1.xml) and we do see that this URL is listed (https://poc.easy-software.com/home-office-calismanin-anahtari-kagitsiz-ve-akilli-surecler/) and it loads as a 404.

    Can you please try resetting our indexables in the database tables by following the steps below?
    1. Install & activate the?Yoast Test Helper plugin
    2. Go to Tools > Yoast Test
    3. Locate the Yoast SEO section and click on the ‘Reset indexables tables & migrations’, ‘Reset Prominent words calculation’, and ‘Reset Internal link counter’ buttons. After each click, the page will reload to confirm that each reset was successful. Note: Resetting the optimization doesn’t undo any of the hard work you’ve put into the plugin as the SEO data is also stored in WordPress’ default tables. It’ll just reset the custom Yoast tables that contain the combined data pulled from those default tables.
    4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization” button to allow Yoast to rescan your?content.

    After it completes, could you check if that fixes the issue?

    Otherwise, you might have another post under a different URL that has that particular canonical URL in the advanced tab, which could be a possible culprit as well.

    Thread Starter gerryj

    (@gerryj)

    I’ve followed the steps you descript but those URLs are still in the sitemap.
    The links should still work you can check it yourself.

    I highly doubt that any post has one of those URLs as its canonical URL. All those URLs are from the old Turkish translation and I’m pretty sure those URLs aren’t used in other languages.

    Is there anything else I can try?

    • This reply was modified 2 years, 8 months ago by gerryj.
    Plugin Support Maybellyne

    (@maybellyne)

    Hello Gerry,

    Thanks for following up.

    Indeed, https://poc.easy-software.com/home-office-calismanin-anahtari-kagitsiz-ve-akilli-surecler/ throws a 404 and is still present in https://poc.easy-software.com/post-sitemap1.xml.

    However, I see you are using LiteSpeed Cache for WordPress (LSCWP) plugin; a caching problem is plausible. Can you please clear the cache and see if there’s a difference?

    Thread Starter gerryj

    (@gerryj)

    I’ve purged the Cache, but sadly nothing changed.

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    It looks like it might be an issue related to remnants of translated pages from WPML as they’re still appearing in the sitemap, and not standard posts or pages that have just been deleted or removed. We’ve already checked the usual things such as caching, resetting the data, and possibly having a post or page with this same canonical URL.

    We’d need to investigate this further but we are unable to do so over these public forums. You may want to get a Yoast SEO Premium subscription so we can correspond over email and check on your site further.

    In a perfect world: He needs the following…
    add_filter( ‘wpseo_exclude_from_sitemap_by_URL’s’, function

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    He did mention that he was unable to find the IDs to these translated posts/pages using WPML. We’re not exactly sure where the issue here is, as it might need some further investigation in order to remove these non-existing URLs anymore from the sitemap.

    I marked this thread as resolved due to a lack of activity by the original poster. The original poster is always welcome to re-open this topic.

    If you are not the original poster but have a similar issue, please read this post before opening a new request.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘can’t remove old translated pages from the sitemap?’ is closed to new replies.