Attachment Pages Redirect

Описание

There are three possible scenarios where this plugin does something:

A) A visitor lands on an attachment page and the parent post is available (not in trash or deleted). A 301 redirect will be issued to redirect the visitor to the parent post.

B) A visitor lands on an attachment page and the parent post was already deleted from trash. A 302 redirect is issued to home page (this can be changed to 301 if you want, see FAQ for more details).

C) A visitor lands on an attachment page and the parent post is in trash, therefore not available for the visitor. It returns a 404 error code to prevent endless redirection loop in old WP releases and redirecting to trashed/not available posts.

There is no options page, simply activate it and will do the job.

If you’re happy with the plugin please don’t forget to give it a good rating, it will motivate me to keep sharing and improving this plugin (and others).

Требования

  • WordPress 4.8 or higher.

Установка

  • Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation (or install it directly from your dashboard) and then activate the Plugin from Plugins page.

Часто задаваемые вопросы

Installation Instructions
  • Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation (or install it directly from your dashboard) and then activate the Plugin from Plugins page.
Will this plugin works in WordPress older than 4.8?

It should work with WP 3.3 or newer, but I’m not supporting versions older than the one required in this readme.

Can I change the HTTP codes used for the redirections?

Since version 1.1 you can do this by adding constants to your wp-config.php file. The example below will switch the redirection codes used by default.

define( 'ATTACHMENT_REDIRECT_CODE', '302' );
define( 'ORPHAN_ATTACHMENT_REDIRECT_CODE', '301' );

Use this at your own risk, only if you know what you’re doing!! No support will be offered for this.

Отзывы

Muchisimas gracias

Gracias Samuel, funciona de lujo. Redirige los adjuntos huérfanos perfectamente para un buen seo.

Se agradece un montón y me ahorras muchas horas de trabajo. Por favor mantenlo actualizado siempre si haces el favor, es un muy buen plugin, sencillo pero super útil.

Saludos ¡ ¡

Does what it says

Just install it, activate it and forget about the pages WP creates automatically for all the media you upload.

Solo instalalo, activalo y olvídate de las paginas creadas automáticamente por WP por cada archivo multimedia que subes.

It works!

Couldn’t get yoast seo to do it but this one does it perfect!

Посмотреть все 30 отзывов

Участники и разработчики

«Attachment Pages Redirect» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

«Attachment Pages Redirect» переведён на 1 язык. Благодарим переводчиков за их работу.

Перевести «Attachment Pages Redirect» на ваш язык.

Заинтересованы в разработке?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Журнал изменений

1.1

  • Minor coding standards improvements.
  • Added ATTACHMENT_REDIRECT_CODE and ORPHAN_ATTACHMENT_REDIRECT_CODE constants to allow change the HTTP redirection codes (e.g. change 302 to 301 for orphan attachments)
  • Prevent endless redirection loop in old WP releases and redirecting to trashed/not available posts if an attachment page is visited when parent post is in trash. Returning a 404 error in this case.

1.0

  • Первая версия.