Comments on: How to Disable WordPress Attachment Pages in 2024 (And Why) https://themeisle.com/blog/redirect-wordpress-attachment-pages/ WordPress Tutorials and Reviews for Beginners and Advanced Thu, 28 Mar 2024 11:40:08 +0000 hourly 1 https://wordpress.org/?v=6.2.4 By: Meetu Sehgal https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-2127 Sat, 07 Jul 2018 19:00:00 +0000 https://themeisle.com/blog/?p=10408#comment-2127 Thanks a ton… Helpful explanation and solution.

]]>
By: Ankit Sharma https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1811 Tue, 17 Apr 2018 02:09:00 +0000 https://themeisle.com/blog/?p=10408#comment-1811 In reply to Max Theiss.

Its Redirecting to Home page. Can we redirect it to post page itself. If yes can you please help me with the code.

]]>
By: Ankit Sharma https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1810 Tue, 17 Apr 2018 01:59:00 +0000 https://themeisle.com/blog/?p=10408#comment-1810 I think Advanced >> Permanent links are gone with version 7.2 they now only have redirect to image instead of post which is so useless. How to do that with the latest version now.

]]>
By: Havi Goffan https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1709 Sat, 17 Mar 2018 23:12:00 +0000 https://themeisle.com/blog/?p=10408#comment-1709 In reply to Priya K.

Yes, Priya. This is quite a nightmare. I have a website packed with images. I need those images to rank but as images. As it was before. The rest has me extremely confused. What happens if one image is attached to two different articles? Or unattached like logos? Anybody shedding some light here would be truly appreciated.

]]>
By: Priya K https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1707 Fri, 16 Mar 2018 23:45:00 +0000 https://themeisle.com/blog/?p=10408#comment-1707 In reply to dare2gocom.

Like you said, the redirect fix is to be used with care. The recent update released on 6th March alters the way the plugin handles unattached media items as well.

]]>
By: Priya K https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1706 Fri, 16 Mar 2018 23:38:00 +0000 https://themeisle.com/blog/?p=10408#comment-1706 To redirect the image attachment pages to parent post, the plugin only needs you to check the Redirect option and save changes, nothing further. If the links continue to appear in the SERPs, it’s possible that you may have to wait a while for SERPs to update.

Also, Yoast 7.0 has been released on 6th March, 2018 and is a major update to many aspects of the plugin, including the redirect option. Here’s the link: https://yoast.com/wordpress/plugins/seo/change-log-wordpress-seo/

]]>
By: Pixel Web Soft https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1700 Thu, 15 Mar 2018 12:53:00 +0000 https://themeisle.com/blog/?p=10408#comment-1700 In reply to Max Theiss.

As simple as that! Saved my day 🙂

]]>
By: Diego! https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1670 Mon, 05 Mar 2018 20:21:00 +0000 https://themeisle.com/blog/?p=10408#comment-1670 In reply to Max Theiss.

Max! Many thanks for your knowledge.
You save me!
I don’t know why but with the Yoast SEO does not work and neither the PHP code (Make a loop)
Thanks

]]>
By: dare2gocom https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1209 Fri, 22 Dec 2017 15:09:00 +0000 https://themeisle.com/blog/?p=10408#comment-1209 The catch with WordPress ‘unattached media items’: every image you integrate in a post via a gallery (like Jetpack’s Tiled Galleries’) shows in the media library as “unattached”! You have to be really careful not to remove such files via a plugin (as some people suggest).

]]>
By: Max Theiss https://themeisle.com/blog/redirect-wordpress-attachment-pages/#comment-1197 Sat, 16 Dec 2017 13:57:00 +0000 https://themeisle.com/blog/?p=10408#comment-1197 But an extra plugin?
simply into the function. php

##

function mytheme_redirect_attachment_page() {
if ( is_attachment() ) {
global $post;
if ( $post && $post->post_parent ) {
wp_redirect( esc_url( get_permalink( $post->post_parent ) ), 301 );
exit;
} else {
wp_redirect( esc_url( home_url( ‘/’ ) ), 301 );
exit;
}
}
}
add_action( ‘template_redirect’, ‘mytheme_redirect_attachment_page’ );

##

]]>