• Resolved bloup

    (@bloup)


    Rank math redirects the media attachment pages to their parent page (post or page) or homepage when there is no parent page.

    I think it is a wrong approach. The best approach is the one from Yoast. Attachment pages should redirect to the media URL. For instance: /screenshot-bloup/ should redirect to /screenshot-bloup.jpeg

    My website was already penalized because all attachment pages redirected to the homepage.
    So, for instance, if you 10000 images with no parents, All their attachment pages will redirect to one page, the homepage. It would be safe if every file would redirect to their media url like /jojo.pdf /jojo.jpeg ….

    Some people may say that google will never find the attachment pages. You are wrong, because of auto-guessing, auto complete, and sometimes redirection of plugins, it may find it.

Viewing 1 replies (of 1 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @bloup,

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

    Please use the following filter to redirect attachment to file URL:

    add_filter( 'rank_math/frontend/attachment/redirect_url', function( $redirect, $post ) {
        return $post->guid;
    }, 10, 2 );

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘the problem with attachment page redirections’ is closed to new replies.