Uploaded Products Keep Going to Different Pages Wordpress

Exercise y'all want to disable epitome attachment pages in WordPress?

Image attachment pages can await like incomplete pages on your site. If a visitor views these, and then it can leave a poor impression.

In this article, we'll show you how to disable image zipper pages in WordPress and redirect information technology to the parent post.

How to disable image attachment pages in WordPress

Why Should You Disable Image Zipper Pages in WordPress?

By default, WordPress creates a unmarried page for every media zipper you have on your site.

This includes images, audio/video files, pdfs, and more than. Some users might discover this functionality useful, however, most WordPress websites don't need information technology.

For example, a photography theme could employ the attachment page to brandish EXIF data. This could show the camera model used, the camera settings, and even the image's location information.

Frequently we go complaints from users who accidentally linked their images to the zipper pages, and they don't similar the mode it looks.

This is a big result considering many themes don't accept special templates for the image attachment pages.

Sometimes an epitome on your website can become popular, and people might start landing on the attachment page directly from Google.

Ideally, y'all desire visitors to country on your postal service and run into the epitome in the context yous have used it.

This is why we always recommend users to disable image attachment pages on their WordPress web log.

How to Disable Epitome Zipper Pages in WordPress (2 Methods)

In that location are two ways to disable paradigm attachment pages in WordPress.

The beginning approach uses WordPress plugins, while the second involves adding custom lawmaking to WordPress.

You'll desire to choose the method that's best suited for your skills.

Method 1: Disable Image Zipper Pages in WordPress (with a Plugin)

The easiest way to disable epitome attachment pages is to employ a WordPress plugin. This method is beginner friendly and requires no coding.

We recommend using All in One SEO. It's the all-time SEO plugin for WordPress used by over 2 1000000 sites.

The first thing y'all'll demand to do is install and actuate the plugin. To do this, see our guide on how to install a WordPress plugin.

One time the plugin is installed and activated, yous'll take a new menu item called 'All in One SEO'.

Navigate to All in One SEO » Search Appearance. Next, click the 'Media' navigation tab.

All in One SEO search appearance media setting

The starting time setting is 'Redirect Attachment URLs'. Y'all tin can disable the setting entirely, redirect to the attachment page, or the zipper parent folio.

We recommend redirecting to the 'Zipper Parent' page. That way, when a user lands on the paradigm attachment page, they'll exist redirected to your article instead.

All in One SEO select attachment parent

One time yous select your preferred setting, make sure to click 'Save Changes' earlier exiting the screen.

If y'all aren't using the All in Ane SEO plugin, you can still disable image attachment pages and redirect users to a parent post using a plugin called Attachment Pages Redirect.

All you take to do is install and actuate the plugin. It'll automatically start redirecting users that land on attachment pages to the parent post.

If no parent post is establish, then users will be redirected to your homepage.

This plugin works out of the box and has no settings page. Unproblematic and easy.

Method 2: Disable Image Zipper Pages in WordPress (with Lawmaking Snippet)

Another option is to add a code snippet to WordPress that accomplishes the same goal every bit the plugin above.

If you don't want to use a plugin or feel that you're already using too many WordPress plugins, then you can utilize this method.

First, you'll need to create a new file in your WordPress theme folder and name information technology paradigm.php. If your theme already has an image.php file, then y'all'll demand to edit that file instead.

After that, all you accept to do is add together the following code every bit the showtime line in your image.php file:

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

Next, you lot need to salve the paradigm.php file and upload information technology to your theme directory using FTP or your WordPress hosting control panel.

At present, when a user lands on your image attachment page, they'll be redirected to the parent post.

Nosotros promise this article helped you disable image zipper pages in WordPress. You may also want to see our beginner'due south guide to paradigm SEO and our guide on how to ready common image issues in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can too find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support u.s..

chumleythicithe2002.blogspot.com

Source: https://www.wpbeginner.com/wp-tutorials/how-to-disable-image-attachment-pages-in-wordpress/

0 Response to "Uploaded Products Keep Going to Different Pages Wordpress"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel