Redirect WordPress attachment pages for unattached images
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
CHANGELOG.md
README.md
composer.json
composer.lock
readme.txt
redirect-unattached-images.php

README.md

Redirect Unattached Images

Redirect WordPress attachment pages for all unattached images to the current site's home page.

Contributors: Robert Neu
Requires: 4.1.2
Tested up to: 4.2
License: GPL-2.0+

Description

The default behavior in WordPress is to generate attachment pages for all of the images in your media library. While this can sometimes be useful, it can also cause problems.

When you upload an image to your media library without inserting it into a post or page, it becomes an unattached image. By default, these images generate attachment pages with no pretty permalink structure. This isn't very useful for anyone, including search engines.

This plugin takes all of these unattached images and safely redirects them using a 301 redirect to your site's home page. If you're using WordPress multisite, it redirects to the current site's home page. There are no options or settings, just install, activate, and enjoy better SEO and fewer useless pages on your website!

Installation

Upload

  1. Download the latest release from GitHub.
  2. Go to the Plugins → Add New screen in your WordPress admin panel and click the Upload tab at the top.
  3. Upload the zipped archive.
  4. Click the Activate Plugin link after installation completes.

Manual

  1. Download the latest release from GitHub.
  2. Unzip the archive.
  3. Copy the folder to /wp-content/plugins/.
  4. Go to the Plugins screen in your WordPress admin panel and click the Activate link under Redirect Unattached Images.

Read the Codex for more information about installing plugins manually.

Git

Clone this repository in /wp-content/plugins/:

git clone https://github.com/wpsitecare/redirect-unattached-images.git

Then go to the Plugins screen in your WordPress admin panel and click the Activate link under Redirect Unattached Images.

Updating

Although it's not likely that this plugin will need updated, there is always the possibility that a change will be required. Fortunately, there are a couple of options you can install to manage updates from GitHub-hosted plugins: