Changing Links to Spans with Robots.txt Blocked Redirects using Linkify/jQuery
-
Hi,
I was recently penalized most likely because Google started following javascript links to bad neighborhoods that were not no-followed. The first thing I did was remove the Linkify plugin from my site so that all those links would disappear, but now I think I have a solution that works with Linkify without creating crawlable links. I did the following:
-
I blocked access to the Linkify scripts using robots.txt so that Google won't execute the scripts that create the links. This has worked for me in the past with banner ads linking to other sites of mine. At least it appears to work because those sites did not get links from pages running those banners in search console.
-
I created a /redirect/ directory that redirects all offsite URLs. I put a robots.txt block on this directory.
-
I configured the Linkify plugin to parse URLs into span elements instead of a elements and add no follow attributes. They still have an href attribute, but the URLs in the href now point to the redirect directory and the span onclick event redirects the user.
I have implemented this solution on another site of mine and I am hoping this will make it impossible for Google to categorize my pages as liking to any neighborhoods good or bad. Most of the content is UGC, so this should discourage link spam while giving users clickable URLs and still letting people post complaints about people that have profiles on adult websites. Here is a page where the solution has been implemented https://cyberbullyingreport.com/bully/predators-watch-owner-scott-breitenstein-of-dayton-ohio-5463.aspx, the Linkify plugin can be found at https://soapbox.github.io/linkifyjs/, and the custom jQuery is as follows:
jQuery(document).ready(function ($) { 2 $('p').linkify({ tagName: 'span', attributes: { rel: 'nofollow' }, formatHref: function (href) { href = 'https://cyberbullyingreport.com/redirect/?url=' + href; return href; }, events:{ click: function (e) { var href = $(this).attr('href'); window.location.href = href; } } }); 3 });
-
-
I know I was penalized because search console recorded an overnight drop in impressions/clicks of 75%. Never was a problem before. I didn't need to run Screaming Frog or anything to find links that explain the problem. I just browsed some of the user generated content and then once I realized that Google was crawling javascript generated links it all made sense.
Some of the sites people were liking to included: CheaterLand.com, PredatorsWatch.com, DirtyHomeWreckers.com, EscortBabylon.net, SugarDaddyforMe.com, GFEMonkey.com, EscortBabylon.com, CityXGuide.com, and AdultLook.com.
I think as long as Google respects the robots.txt directives I should be just fine. The redirect page itself is blocked by robots.txt so even if Google finds one of those URLs (ex: https://cyberbullyingreport.com/redirect/?url=https://moz.com/community/q/changing-links-to-spans-with-robots-txt-blocked-redirects-using-linkify-jquery) it shouldn't even follow the 302 since the robots.txt file (https://cyberbullyingreport.com/robots.txt) disallows that directory.
-
301 or 302 redirecting well if you’re going to do one you should do 302 but it’s not going to help you much unless you’re going to send the URL to a 410 when something is no followed it is the same thing as what robots.txt will do.
https://support.google.com/webmasters/forum/AAAA2Jdx3sUEbHp0yjgT6c?hl=sv
do you have a report from Google knowing that you have been penalized?
is there anyway you could run Screaming Frog and show some of these URLs that you’re talking about?
respectfully,
Tom
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Too many dofollow links = penalty?
Hi. I currently have 150 backlinks, 90% of them are dofollow, while only 10% are nofollow. I recently hit position #10 for my main keyword, but now it is dropped to #16 and a lot of related keywords are gone. So I have a few questions: 1. Was my website penalized for having an unnatural backlink profile (too many dofollow links), or maybe this drop in positions is just a temporary, natural thing? 2. Isn’t it too late for making the backlink profile look more natural by building more nofollow backlinks and making it 50%/50%? Thank you!
White Hat / Black Hat SEO | | NathalieBr0 -
Nofollow for reciprocal links?
Hi, We have reciprocal links with our business partners. Their websites have been listed on our website with "nofollow" links and they link to our website with "nofollow" or "dofollow" links. Is this wrong having reciprocal links? And if they are our partners, "nofollow" or "dofollow" is better? I don't think there will be anymore link juice loss with dofollow links from our website?
White Hat / Black Hat SEO | | vtmoz0 -
It's not link buying, but...
Which of these strategies, if any, cross the line from relationship building to link buying? Assume all links are do-follow. You're a local business. You give the local Boys & Girls club a few hundreds buck a year. In return, you get a very nice link on their Sponsorship page for 12 months. You send a sample of your product to influential bloggers, for the purpose of a review and hopefully a link back to your website. One of your clients is a college bar. You invite 50 college kids over for a slow evening and stuff them full of chicken wings. Then, you ask them to please review and link to the bar on their college wiki. You give a client a free service, in exchange for that client linking to your business on its blog roll. You take a blogger out to lunch, and pick up the tab. Later that day, the blogger writes up an amusing little story for the blog, and links back to your desired website. In your email newsletter, you put out a request to your customer base, "Please link to my website, and I'll provide you a special 20% off coupon."
White Hat / Black Hat SEO | | ExploreConsulting1 -
Getting Back Links When I Cannot Add Outbound Links to My Site
I have a collection of websites that I do not control in terms of content or page creation/editing. As a result, I have no way to add links to outside sites on any existing or new pages. Given this, how can I go about finding and requesting other sites link back to our sites/pages if I cannot offer them a link to their site in return? I know that content is a link driver, but I do not control the content, so I cannot develop new content to help drive links. I appreciate any help/advice any experts can provide.
White Hat / Black Hat SEO | | dsinger0 -
Does Google Consider a Follow Affiliate Link into my site a paid link?
Let's say I have a link coming into my domain like this http://www.mydomain.com/l/freerol.aspx?AID=674&subid=Week+2+Freeroll&pid=120 Do you think Google recognizes this as paid link? These links are follow links. I am working on a site that has tons of these, but ranks fairly well. They did lose some ranking over the past month or so, and I am wondering if it might be related to a recent iteration of Penguin. These are very high PR inbound links and from a number of good domains, so I would not want to make a mistake and have client get affiliates to no follow if that is going to cause his rankings to drop more. Any thoughts would be appreciated.
White Hat / Black Hat SEO | | Robertnweil10 -
Link idea? good or bad?
OK so my website ranks fairly well for keywords i would say 50-60 % are ranking in the top 3 my DA is 15 and PA is 28 I have a few other sites that i blog on that i own they have a DA of 11 and PA of 20 i was thinking of just guest posting on those using a keyword Anchor text that im not ranking for and seeing what that would do. I was thinking of creating a few other sites and just blog about random stuff for 3-6 months generate traffic and start guest posting redirecting links back towards me. Is this bad?
White Hat / Black Hat SEO | | gslc0 -
Penguin link removal what would you do?
Hi Over the last 4 months I have been trying to remove as many poor quality links as possible in the hope this will help us recover. I have come across some site's that the page our back-link is on has been de-indexed, goggle shows this when I look at the cached page... 404. <ins>That’s an error.</ins> The requested URL /search?sourceid=navclient&ie=UTF-8&rlz=1T4GGNI_enGB482GB482&q=cache:http%3A%2F%2Fforom.eovirtual.com%2Fviewtopic.php%3Ff%3D4%26t%3D84 was not found on this server. <ins>That’s all we know.</ins> If goggle is showing this message do I have to still try to remove the link, or is it a case goggle has already dismissed the link?
White Hat / Black Hat SEO | | wcuk0 -
When asking for links, what are good incentives to offer?
New to SEO and want to stay clean, What are white hat incentives you can offer in exchange for links? Giveaway for their readers? Give them helpful advice? Record video of me drinking a gallon of milk within 5 minutes?
White Hat / Black Hat SEO | | 10JQKAs0