Archived topic
Add html to product descriptions
15 replies · Started by johnaps on January 17, 2020
Hello!
I want to add a small div with a link attribute on all my product descriptions but as i have over 2k products i cant do it by hand one by one...
I have found the description.php in woocommerce files that maybe i can change a bit to accomplish that but i am not very used on php...
Can you tell me where i can implement my html code so it will be imported on all product descriptions?
*Its important it will be on product descriptions as what i am trying to achieve with my html is "copyright protection" with a div that will link back to my site if anyone copies my product description*
Your help would be greatly appreciated!
If you please can forward this directly to Tom it would be very much appreciated, any idea would be very helpful...
I know it isnt about fixing or extending gp capabilities but i think Tom could help me out. If it isnt much trouble please sent it directly to him!
Thank you for your time!
Hi there,
You can use the Hook Element to insert the HTML:
https://docs.generatepress.com/article/hooks-element-overview/
The list of available hooks for the single product can be seen here:
https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
You will find most of them available in the Hook Element.
Is there a way to make the text on product pages have a hidden link?
I tried using
and
on woocommerce_after_single_product_summary
but when i copy the whole text, the div link isnt visible on my html editor..
Maybe there is a way to implement some php code there to put a hidden link somehow to all text in product description?
If you can forward it to Tom, it would be very helpful as i think he maybe the only one that he can be of help.
If you can forward it, and bounce any idea with me, it will be greatly appreciated.
Thank you for your time!
Can you share the HTML you're trying to add ?
I tried using
"div action="my-site-url""
on woocommerce_before_single_product_summary
and
"/div"
on woocommerce_after_single_product_summary
but that didnt work as expected...
Maybe there is a way to implement some php code there to put a hidden link somehow to all text in product description?
i used " instead of <> because of visibililty problems in your reply post form
If you can please forward this to Tom! Thank you!
Hi there,
Can you explain a little more about what you're trying to accomplish? What is this link going to do?
Thanks!
Hello Tom, first i wanna thank you for your time!
What i am trying to do is protecting my content when someone copies it...
As there are many ways to scrape data off a site i thought and wanted to make all text on my product descriptions have a hidden link to my site nested inside the html...
Thats what i tried doing with the div, but didnt work...
Do you have any ideas?
So the idea is if someone copies your content, they'll copy a link to your site along with it?
Yep a hidden link in the html!
Wouldn't they just remove the link once they pasted it elsewhere?
Would it be better to just prevent copy/pasting your content?: https://wordpress.org/plugins/wp-content-copy-protector/
A data entry company that i hired had some products copied from a competitor of mine and those products had in the html description at the start a div action="competitorurl" that did a backilink to him... Ofc that was done by a mistake but i am trying to replicate that situation to my advantage... Isnt there a way to implement a link not necessarily with href, that is hidden in the description html;
I dont really know , i would like your opinion on that...
I don't think that would count as a backlink, and doing something like this would likely just make Google mad (it's not exactly ethical).
I think you'd be better off using the plugin I mentioned - it will prevent people from copying your text, and you don't risk making Google mad.
Thank you for your advice!!!