How to Disable Image Attachment Pages in WordPress

How to Disable Image Attachment Pages in WordPress
Lesha Dubose

Google and other search engines will still index your images themselves, what this does is remove the auto generated pages that WordPress creates for each image which have no content and for most sites serve no purpose. You aren’t disabling access to the image itself just the WP generated posts. Make sense? Even if you “detach” the images WordPress still create a post for them which can be accessed on the front-end which is why you need to redirect all of them either via code or Yoast’s redirection setting.

How to Disable Image Attachment Pages in WordPress
Faustina Sadler

Second Plugin
Most of the users have WordPress SEO By Yoast plugin installed. In case, you do not have it, go ahead and install it. Apart from protection, you will avail yourself a lot of features with just one plugin.
Once installed and activated, go to SEO option from the left menu of the Dashboard and click on Permalinks option from the drop down. You will see the option “Redirect Attachment URL’s to parent post URL”. So, the next time some tries to access the media attachment pages intentionally or accidentally, they will be redirected to the homepage.

How disable image attachment pages in WordPress?
Melda Rapp

Фрагмент кода ниже , включает запасной вариант вам нужно для того , чтобы перенаправить конечного пользователя на главную страницу (или любую другую страницу) в том случае, если ни одна должность страница родитель не может быть найден.
Это происходит , когда элементы медиа загружены непосредственно в медиа – библиотеку , а не через пост или страницу.

Be the first to comment

Leave a Reply

Your email address will not be published.