• Resolved amsgator

    (@amsgator)


    I’m sure you get tired of being compared to Yoast, so I apologize, but one of the features I miss from Yoast is the ability to redirect attachment URLs to the attachment itself (i.e. the actual image URL).

    This seems like a more logical response than a redirect to the parent page, especially when the same image often appears on multiple pages/posts throughout the same site.

    I’m currently using a custom function to accomplish this, but I would really like to be able to enable it from within the SEOPress dashboard. Is this something that can be considered for a future update?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter amsgator

    (@amsgator)

    I thought I had posted about this a few months ago but it wasn’t showing up when I searched for it. Well I just found the previous thread in my dashboard under the topics I started, so sorry for the duplicate topic.

    For those interested, this is the function I’m using until it (hopefully) gets added to the plugin:

    function redirect_attachment_urls() {
        if ( is_attachment() ) {
            wp_redirect( wp_get_attachment_url(), 301 );
            exit();
        }
    }
    add_action( 'template_redirect', 'redirect_attachment_urls' );
    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,
    yes this feature is already in the todo list.
    I hope to include it for the next major release (this month).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect Attachment URLs to the Attachment Itself’ is closed to new replies.