Sunday, November 29, 2020
Home Blogging How to Disable Image Attachment Pages in WordPress

How to Disable Image Attachment Pages in WordPress

WordPress by default creates a single web page for every attachment that you’ve got in your website. This contains pictures, audio/video recordsdata, pdfs, and so on. This performance is nice for photographers, however not a lot for the remainder of us. Typically we get complaints from freshmen who unintentionally linked their pictures to the attachment pages, they usually don’t like the best way it seems. That’s a giant challenge as a result of a variety of themes don’t have particular templates for the picture attachment pages. Typically a picture in your web site can change into in style and folks may begin touchdown on the attachment web page straight from Google. Ideally you’d need them to land in your publish and see the picture within the context you could have used it. On this article, we are going to present you learn how to disable picture attachment pages in WordPress.

If you’re already utilizing WordPress web optimization by Yoast plugin, then go to your web optimization » Permalinks choices web page. All it’s important to do is test the field subsequent to “Redirect attachment URL’s to guardian publish URL”. This can redirect customers arriving at attachment pages to the guardian publish.

For individuals who aren’t utilizing the WordPress web optimization by Yoast plugin, you possibly can nonetheless disable picture attachment pages and redirect customers to guardian publish utilizing one other plugin referred to as Attachment Pages Redirect. All it’s important to do is set up and activate the plugin. Upon activation the plugin begins redirecting customers touchdown on attachment pages to guardian publish. If no guardian publish is discovered, then the customers are redirected to homepage. This plugin works out of the field and has no settings web page. Easy and simple.

If you’re amongst those that don’t like plugins, then there’s an possibility for you as nicely that. Create a brand new file in your WordPress theme folder and identify it picture.php. In case your theme already has a picture.php file, then it is advisable edit that as a substitute. All it’s important to do is add this code as the primary line in your picture.php file :

1
<?php wp_redirect(get_permalink($post->post_parent)); ?>

Save picture.php file and add it into your theme listing. Now when a customers reaches the picture attachment web page, then they are going to be redirected to the guardian publish.

You May Also Like : How to Add the Facebook Like Box / Fan Box in WordPress

Lastly, simply need to emphasize that there’s nothing flawed with utilizing good plugins. See our article on what number of plugins must you set up in your website. We advocate that everybody use WordPress web optimization by Yoast plugin, so doing that is as easy clicking on one checkbox.

On our website, we haven’t disabled picture attachments totally as a result of there are some cases the place we need to ship people to a selected chart or picture that we’ve on the location. As an alternative what we’ve carried out is that we excluded it from our sitemap. Moreover, we’ve added a meta robots textual content noindex, nofollow to all of our attachment single pages utilizing Yoast’s web optimization plugin. You are able to do this too by going to Titles & Metas tab and going below Put up Sorts. Merely test the noindex, nofollow tag for ONLY the attachment publish kind.

We hope that this text helped you disable picture attachment pages in WordPress and redirect customers to guardian posts. You probably have any questions or suggestions, then please tell us by leaving a remark beneath.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

An Internship Guide about DRDO

Defense Research Development Organization (DRDO) provides an internship to graduates and submit graduate college students. If you're on the lookout for a profession in DRDO...

How to Become a Pilot: Eligibility, Training, Study & Salary

Every little one dreamt of flying. Some wished to fly as passengers whereas others wished to grow to be pilot, taking plane hovering into...

10 Best Online Money Transfer Apps & e-Wallets in India

There was a time when sending cash from one place to a different concerned standing in lengthy financial institution/publish workplace queues, patiently awaiting your...

14 Best Part Time Jobs in Chennai (+Online Jobs)

Chennai is a quickly rising metropolis with a booming auto business. Not simply auto business however Chennai has turn out to be hub for FMCG...

Recent Comments