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
-
How long Google will take to Disavow a link?
Just want to know how long will Google take to Disavow a link? I uploaded my file on 18 Dec 2020 and today is 5th January 2021 and still, that link is appearing in my Search Console in Top linking domains. Anyone who recently done this practice and how long it took? I mentioned the domain name below and hopefully, it will disavow all the links [subdomain+www+without www] coming from that domain. domain:abcd.com Help me out, please...
White Hat / Black Hat SEO | | seotoolsland.com0 -
SEO companies that own linking properties
Hi everyone, I do some SEO work for a personal injury attorney, and due to his profession, he gets cold-called by every digital marketing company under the sun. He recently got called by a company that offers packages that include posting in multiple directories (all on domains they own), creating subdomains for search listings, and PR services like writing and distributing press releases for distribution to multiple media outlets. The content they write will obviously not be local. All this and more for less than $500 a month! I'm curious if any of you have any experience with companies like this and whether you consider them black hat. I realize I'm asking you to speculate on a very broad description of what they offer, but their linking strategies sound risky to me. What experiences have you had with companies like this? Do you know anyone who has ever gotten a penalty using these tactics? Thanks, in advance, for sharing your thoughts.
White Hat / Black Hat SEO | | ptdodge0 -
Do I lose link juice if I have a https site and someone links to me using http instead?
We have recently launched a https site which is getting some organic links some of which are using https and some are using http. Am I losing link juice on the ones linked using http even though I am redirecting or does Google view them the same way? As most people still use http naturally will it look strange to google if I contact anyone who has given us a link and ask them to change to https?
White Hat / Black Hat SEO | | Lisa-Devins0 -
Guest post linking only to good content
Hello, We're thinking of doing guest posting of the following type: 1. The only link is in the body of the guest post pointing to our most valuable article. 2. It is not a guest posting site - we approached them to help with content, they don't advertise guest posting. They sometimes use guest posting if it's good content. 3. It is a clean site - clean design, clean anchor text profile, etc. We have 70 linking root domains. We want to use the above tactics to add 30 more links. Is this going to help us on into the future of Google (We're only interested in long term)? Is 30 too many? Thanks.
White Hat / Black Hat SEO | | BobGW0 -
NoFollow tag for external links: Good or bad?
I have a few sites that have tens of thousands of links on them (most of them are sourcing images that happen to be external links). I know that it's a good thing to externally link to reputable sources, but is it smart to place the nofollow tag on ALL external links? I'm sure there is a good chance that external links from posts from years ago are pointing to sites that may now be penalized. I feel as though nofollowing all the external links could come off as unnatural. What are the pros and cons of placing the nofollow tag on ALL external links, and also if I leave it as is and don't put the nofollow tag on them. Thanks.
White Hat / Black Hat SEO | | WebServiceConsulting.com0 -
Ask Bloggers/Users To Link To Website
I have a web service that help bloggers to do certain tasks and find different partners. We have a couple of thousand bloggers using the service and ofcourse this is a great resource for us to build links from. The bloggers are all from different platforms and domains. Currently when a blogger login to the service we tell the blogger that if they write a blog post about us with their own words, and tell their readers what they think of our service. We will then give them a certain benifit within the service. This is clearly encouraging a dofollow-link from the bloggers, and therefore it's not natural link building. The strategy is however working quite good with about 150 new blog posts about our service per month, which both gives us a lot of new visitors and users, but also give us link power to increase our rankings within the SERP. Now to my questions: This is not a natural way of building links, but what is your opinion of this? Is this total black hat and should we be scared of a severe punishment from Google? We are not leaving any footprints more than we are asking the users for a link, and all blogposts are created with their own unique words and honest opinions. Since this viral marketing method is working great, we have no plans of changing our strategy. But what should we avoid and what steps should we take to ensure that we won't get in any trouble in the future for encouraging our users to linking back to us in this manner?
White Hat / Black Hat SEO | | marcuslind0 -
Does 301 redirection will effect my site in the future?
Hello Guys, I am totally new to SEOMOZ.com, when I had issues with my website I asked one of my friend who does SEO he suggested me to implemented 301 redirection approximately 11 months a go, here is the URL of the website http://www.bharatdesi.com/hyderabad . Will Google ban my website from search engine results, what would be the worst scenarios. know there are really good SEO people who follow SEOMOZ everyday... Can any one here please suggest me with some good answers weather I have to remove 301 redirection or I can still keep the same until my home page gets redesigned. I don't really understand all the concepts of SEO, but if some one can help me with the good answers I can ask my developer to the same. Thank you
White Hat / Black Hat SEO | | Vinss0 -
Ditching of spammy links - will it be of benefit?
Hi there. We have recently taken over the SEO for a five-star hotel who rank very well already for a lot of their main terms, largely down to the fact they have decent off-site strength (as yet very little on-page optimisation has been done, so they aren't appearing for some quite key terms). This off-page strength includes around 2000 links, giving the home page an authority of 63 in the OSE tool. However, upon looking at the links to check they were pointing to the most relevant page etc, I notice they have A LOT of spammy links, pointing to their site with anchor text like 'cheap cialis' or 'buy valium'. Clearly these aren't the kinds of links that should be pointing to a five-star hotel, but should I expect to see much of a drop by attempting to remove these links? We obviously want to clean their link portfolio up, but I'm not sure they would be too happy if all their top rankings disappeared - even if only temporarily, and even if done with the best intentions. I ask as none of the other sites we handle SEO for have had such a proliferation of these links, so I've not seen the ramifications in full. Any help would be much appreciated, along with advice on the best way to remove these links.
White Hat / Black Hat SEO | | themegroup0