- This topic has 31 replies, 5 voices, and was last updated 3 years, 7 months ago by
Elvin.
-
AuthorPosts
-
February 7, 2022 at 5:55 pm #2108900
mad2toi
Hello, I have internal links in nofollow and I would like any dofollow. What is the add filter please action?
February 7, 2022 at 6:07 pm #2108905mad2toi
In comment
February 7, 2022 at 11:28 pm #2109033Fernando Customer Support
Hi mad2toi,
You can try adding a unique CSS class to the specific button, and use this class as a selector to perform JS to modify its rel attribute.
See this for reference: https://share.getcloudapp.com/wbuYBW0x
In my sample, I added website_url class to the button. I then created a Hook Element which I hooked to wp_footer. The code I added is this:
<script> const website_url = document.querySelector('.website_url'); window.onload = function(){ website_url.setAttribute('rel', 'dofollow'); } </script>
See this for reference: https://share.getcloudapp.com/2Nuv955X
Here it is working in my site: https://share.getcloudapp.com/KouYKBBd
Moreover, here is a reference to rel values you may use: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
Hope this helps! 🙂
February 13, 2022 at 4:52 pm #2117178mad2toi
Hello, thank you for answering me if you do not have a function.
February 13, 2022 at 9:21 pm #2117311mad2toi
Access
February 13, 2022 at 10:00 pm #2117335Fernando Customer Support
To have a better understanding of inquiry, may we know which specific links you’re referring too? Can you also kindly send a screenshot of these link?
Moreover, may we also know how you’re adding these “internal links”?
Hope to hear from you soon! 🙂
February 13, 2022 at 10:04 pm #2117339mad2toi
February 13, 2022 at 10:07 pm #2117341mad2toi
February 13, 2022 at 11:42 pm #2117384Fernando Customer Support
This warning triggers for any internal URL which was linked to internally using both follow and nofollow.
See this link for reference: https://sitebulb.com/hints/links/url-receives-both-follow-nofollow-internal-links/#:~:text=This%20Hint%20will%20trigger%20for%20any%20internal%20URL%20which%20was%20linked%20to%20internally%20using%20both%20follow%20and%20nofollow%20links.
To remove this warning, you would need to set either only follow or only nofollow for a URL.
For GenerateBlock blocks, to make a link nofollow or follow you can toggle the Add rel=“nofollow” option.
See this for reference: https://share.getcloudapp.com/YEuBYq2j
If you wish to remove all rel attribute for all links, you can try adding this JS through a Hook Element:
<script> const elems = document.querySelectorAll('a[rel*="nofollow"]'); var index = 0; var length = elems.length; for ( ; index < length; index++) { elems[index].removeAttribute("rel"); } </script>
See: https://share.getcloudapp.com/NQuxmkbr
Also see: https://share.getcloudapp.com/KouY50y4
Hope this helps! 🙂
February 14, 2022 at 7:26 am #2117908mad2toi
Hi, i have a bad result sorry
February 14, 2022 at 10:49 am #2118422David
StaffCustomer SupportHi there,
if those errors appeared after making the above changes then you should remove those changes.
But none of these are theme related.February 14, 2022 at 11:01 am #2118440mad2toi
Thank you but the problem is still not solved
February 14, 2022 at 7:23 pm #2118841Fernando Customer Support
I see, if that’s the case, since this isn’t theme related, it would be best to refer to the “How to fix” guidelines/instructions provided along with the warnings/errors in your screenshots.
See: https://share.getcloudapp.com/z8ukW9LQ
Feel free to reach out anytime if you’ll need help with anything else. 🙂
February 15, 2022 at 9:57 am #2119900mad2toi
Hi
I need code :
add_action( ‘wp_footer’, ‘twentytwentyone_add_ie_class’ );
function dofollow($url) {
$url = str_replace(‘ nofollow’, ”, $url);
return $url;
}
add_filter(‘get_comment_author_link’, ‘dofollow’);But remplace twentytwentyone by ?
February 15, 2022 at 8:22 pm #2120444Fernando Customer Support
Here is a PHP code you can try: https://developer.wordpress.org/reference/hooks/comment_text/#:~:text=Remove%20rel%3D%E2%80%9Dnofollow%E2%80%9D%20from%20comment%20content%20text
Hope this helps! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.