Redirecting Attachment Pages To Media URL

#937756
  • Resolved Zunair Upwork
    Rank Math free

    I have setup rankmath with buddyboss theme and following documentation did the settings. Now, I am facing issues with attachment pages. As mentioned in documentation and youtube tutorial I followed the same steps.

    Rank Math > General Settings > Links > Enable Redirection > Save

    After that adding this snippet in rank-math.php:
    /**
    * Redirect Attachments to media URL
    */
    add_filter(‘rank_math/frontend/attachment/redirect_url’, function ($redirect, $post) {
    return $post->guid;
    }, 10, 2);

    It Should Work as whenever attachment page link clicked its will redirect to media url but in my case this process is only working on staging site but for the main site its only redirecting to homepage or no redirection. I checked both orphan and in use images.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    After applying the settings and the code, please head over to your WordPress dashboard → Settings → Permalinks and save the settings without changing anything.

    If the issue persists, we may need to check your live website. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Redirecting Attachment Pages To Media URL’ is closed to new replies.