-
Hi Support Team,
I am using divi from Elegant Themes and after installing RankMath the buttons which are linked to pdf files don’t work anymore. In the button module setting I’m using a “dynamic” link to a pdf file. Could you please help me with that?
Thank you and best regards,
Günter
-
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.
I’ve checked your site, and I’m assuming that the button you are referring to is the ‘Download job description button’ on the page you provided.
Since you mentioned that it is a link to a PDF file, I’ve disabled the Redirect Attachments option in Rank Math > General Settings > Links
However, the button is just redirecting to another page with the download button for a pdf, and it seems that the pdf is already opening there.
Could you please check and confirm on your end if it should work that way?
Looking forward to helping you.
Thank you.
Hi Reinelle,
yes it works in the same way on my side – after a click on the button a new page with a download link to the pdf is opened. But instead of redirecting to another page the pdf should open directly after clicking the button…
And this behaviour only accurs after installing RankMath. I just made a restore og the original site and then I made an update to WordPress, used theme and all plugins. The button links are working correctly. And after installeing RankMath they don’t work anymore…
Do you have an idea?
Best regards,
GünterHello,
Thanks for your reply.
I tried to login into your website’s admin area to further investigate the issue, but it seems like the login details are not active anymore.
Please provide us with the active login credentials of your website so that we can further investigate the issue.
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.
Hi Prabhat Rai,
the login works again. I forgot to set the correct password after the restore…
Best regards,
GünterHello,
Thank you for the update.
The credentials are already working. However, we also wanted to check how it should work when Rank Math is deactivated. But it seems the access you’ve provided is only for the sub-site.
Could you please elevate the access so we can activate/deactivate Rank Math plugin while troubleshooting?
Looking forward to helping you.
Thank you.
Hi Reinelle,
now the user should have super admin rights.
If you would like to know how the buttons work correctly, please have a look at the origin site, from which I made a copy for the development system:
Best regards,
GünterHello,
Thank you for getting back to us
Upon checking your page in the Divi editor I was able to replicate the issue as the dynamic URL was redirecting to the attachment page instead of directly redirecting to the actual PDF file.
I was not able to access your theme editor to do testing on your site here. Usually, you can use the below filter in the theme’s function.php in order to redirect the attachment URL to the actual media URL.
add_filter( 'rank_math/frontend/attachment/redirect_url', function( $redirect ) { global $post; return $post->guid; });You can refer more to this here: https://rankmath.com/kb/redirect-attachments-to-the-media-url/#how-to-redirect-attachments-to-the-media-url-using-rank-math
Hope this helps. Please let us know if you have any other questions.
Thank you.Hi Brian,
I have added the filter into the functions.php of the child theme. Unfortunately this filter doesn’t fix the problem… Do I have to make any other settings?
Best regards,
GünterHello,
Thank you for getting back to us.
Upon checking your site it seems like it is not working on your end as I can see.
Could you please try to replace the code above with this one:
add_filter( 'rank_math/frontend/attachment/redirect_url', function( $redirect, $post ) { return $post->guid; }, 10, 2 );We tried to add it from our end but it seems your files can only be edited via SFTP as I saw.
Please then make sure that you have enabled the redirect attachments option for this to function well.
We are looking forward to helping you.
Thank you.Hi Brian,
thank you it works. All pdf files are opened directly without linking to the attachment page… It was a “hard work” to get the solution, but finally it works. 🙂
Thank you again and best regards,
GünterHello,
We are super happy that this issue is already resolved.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.
The ticket ‘link to pdf doesn’t work’ is closed to new replies.