Tagged: filters, mediapress, optimization, post share
Hi everyone,
Currently, we have plugin that creates PDF files and that is ok. But, since this plugin loads at the beginning of the page, there is a text “Download this post in PDF format” when we share a page. This is not good because of two reasons: 1) it is a bad UX, 2) SEO reads this text each time, instead of getting meaningful content right away.
How could we remove this text “Download this post in the PDF format” from the beginning of shared text?
Is there some filter we can use? Could you provide us with snippet?
Here is a screenshot of what we have now, where we selected part of the text that we want to remove from share.
https://ibb.co/VQpDxd4Thank you very much!
Kind regards,
MilanHi Milan,
Thank you for the question.Currently, the preview is generated by WordPress(as attachment preview).
Still, your issue is not related to preview. The text “Download this post in the PDF format” seems to be generated by a plugin you are using.
Are you using any plugin to generated pdf of a post? That seems to be doing it. You should report it to the plugin team as preview should not contain this message.
Regards
BrajeshHi Brajesh,
Yes, we are using plugin that is generating text “Download this post in the PDF format” at the top of our posts. This is what we want and this text makes sense in posts.
However, we don’t want it in a BuddyPress preview, when we share link.I will report this to the plugin creators as you suggested.
However is there some mechanism to “filter out” this text?
For example, if we can make some rule to tell WordPress remove “Download this post in the PDF format” text from the beginning of the attachment if available?When we report this to plugin creators it will take some time before they implement it for sure. That is why I am exploring possibility to fix this at the level of our site, with filters or other hooks.
Kind regards,
MilanHi Milan,
the plugin is most probably using the_content to add that text. Also, It is not BuddyPress preview, It is the oembed preview.So, when asking for support, please ask them how to disable it in the oembed preview of the post.
I will suggest waiting for the developers suggestion and see if they provide some filter.
Regards
BrajeshHi Brajesh,
Sadly, DK PDF plugin is no longer supported, so there is nobody I could communicate with.
However, I did my own research and found a working solution.
I will share it here, maybe somebody will find it useful.function modify_excerpt_embed( $output ) { if(is_plugin_active("dk-pdf/dk-pdf.php")) { // Here you can write any modifications to embed excerpt that you want to } return $output; }
So, I am using WordPress hook “modify_exceprt_embed” to modify excerpt, but I am only doing this if DK PDF plugin is active. This way, when we remove this plugin my filter will no longer be active.
This is what I wanted to do in the beginning, find some filter that is good for changing embed output.
Thanks for providing me with additional information.
It was pleasure as always. 🙂All best,
Milan- This reply was modified 4 years, 4 months ago by
Milan Latinovic.
- This reply was modified 4 years, 4 months ago by
Thank you for sharing Milan.
I am glad you found the solution 🙂
Regards
Brajesh
The topic ‘ [Resolved] Is it possible to filter MediaPress share link preview’ is closed to new replies.