• Resolved cmccarter

    (@cmccarter)


    Hello,

    I am using the lite version. I have updated the permalinks for individual pages, that works flawlessly. When it comes to the page attachments, if you try to go direct to the attachment page I get a 404 error. I have enabled yoast re-direct and deleted and re-installed the plugin. Needless to say my sitemap is kicking back errors. Do I need the pro version to also set permalinks for media? Media regen said no slugs modified.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @cmccarter,

    I will take a look at this and try to fix it tonight (will keep you updated), the attachment links should work in Permalink Manager Lite as well.

    Regards,
    Maciej

    Plugin Author Maciej Bis

    (@mbis)

    Hi again @cmccarter,

    I updated the code with hotfixes and now the attachments should work correctly. Please remove the old instance of plugin and reinstall it from the fresh copy.

    Regards,
    Maciej

    Thread Starter cmccarter

    (@cmccarter)

    Hello,

    I deleted and installed the updated plugin, thank you. Unfortunately the attachment pages are still coming up 404 and not redirecting to the parent.

    I can manually update the path back to the default and it re-directs on the test images but that is without the new permalink structure. The default is wordpress defaults, basically example.com/this-is-the-media-file-name instead of example.com/media/files/this-is-the-media-file-name

    Any suggestions? I don’t like the thought of needing to update all image files manually (there are 1500+) but will if I need to to keep consistency and for seo

    Thanks,

    Plugin Author Maciej Bis

    (@mbis)

    Hi @cmccarter,

    please try to update the attachment permalinks with “Regenerate/reset” (please select “Restore native permalinks” mode) tool available from Permalink Manager admin panel.

    The old media permalinks were incorrect and /attachment/ endpoint was missing, now it is corrected.

    If it still does not help, please send me the list of your custom URIs (you can see it in “Debug” section of my plugin).

    Regards,
    Maciej

    Plugin Author Maciej Bis

    (@mbis)

    Hi again @cmccarter,

    I did extra tests and noticed that the front-end permalinks were incorrect if the attachment was attached to any post that uses custom URI different than native one.

    I adjusted the function that filters “attachment_link” hook. I would be grateful if you could reinstall the plugin once again.

    Best regards,
    Maciej

    Thread Starter cmccarter

    (@cmccarter)

    Hello,

    I just completed the task and the attachments seems to function as expected. Now I just need to convince Yoast SEO to updated my sitemaps accordingly and should be good. At the moment they are refusing to do so but that is a separate issue.

    Thanks,
    -c

    Plugin Author Maciej Bis

    (@mbis)

    Hi @cmccarter,

    the Yoast’s sitemaps are cached by default – in this article you can find how to disable transient caching:
    https://kb.yoast.com/kb/sitemap-does-not-update/

    Alternatively, you can use this snippet (please add this to functions.php in your theme folder):

    function pm_flush_yoasts_sitemap() {
    	if(class_exists('WPSEO_Sitemaps_Cache') && isset($_POST['reset_sitemap'])) {
    		WPSEO_Sitemaps_Cache::clear();
    	}
    }
    add_action('admin_init', 'pm_flush_yoasts_sitemap');

    and then trigger it with this $_GET parameter (from Wp-Admin dashboard):
    wp-admin/?reset_sitemap

    Regards,
    Maciej

    • This reply was modified 8 years, 6 months ago by Maciej Bis.
    Thread Starter cmccarter

    (@cmccarter)

    Hello, thank you for that. I have transient caching disabled and went a step further and disabled caching all together for the purposes of testing.

    What is looks like is happening is that yoast doesn’t recognize anything with …/attachment/… the few images that are not in that format show in the sitemap but the other 1300 or so are not. They were all showing before the /attachment/ fix in the yoast sitemap.

    https://www.dfwapartmentnerdz.com/sitemap_index.xml It’s set for 1k itmes per page xml page

    Plugin Author Maciej Bis

    (@mbis)

    Hi @cmccarter,

    there was a small typo in the hook for “attachment_link” filter. I updated the plugin source code again, now all the attachments’ links should be present in Yoast’s sitemap.

    Best regards,
    Maciej

    Thread Starter cmccarter

    (@cmccarter)

    Beautiful Maciej, works great. I appreciate your dedication and swift fix.

    Best
    -c

    Plugin Author Maciej Bis

    (@mbis)

    You’re welcome πŸ™‚ Thank you for the donation!

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

The topic ‘Attachment Media Permalink Redirects’ is closed to new replies.