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
-
Link Getting Deleted for Few Days
If a link gets deleted for few days and re-appears... Will Google treat it as a "new link" or give it the same old link-age.
White Hat / Black Hat SEO | | Akshayshr0 -
Where Is This Link Coming From?
According to Moz Analytics we have a link coming from here: http://www.grayshadowfinancial.com/ The anchor text is earthquake prone map. I can't find the link, but if I cntrl+f "earthquake prone map" it shows in the find box, even though I can't see it. I'm guessing this is some spam tactic and they are hiding this with their CSS? Is there anyway I could see it? Best, Ruben
White Hat / Black Hat SEO | | KempRugeLawGroup0 -
Negative SEO and when to use to Dissavow tool?
Hi guys I was hoping someone could help me on a problem that has arisen on the site I look after. This is my first SEO job and I’ve had it about 6 months now. I think I’ve been doing the right things so far building quality links from reputable sites with good DA and working with bloggers to push our products as well as only signing up to directories in our niche. So our backlink profile is very specific with few spammy links. Over the last week however we have received a huge increase in backlinks which has almost doubled our linking domains total. I’ve checked the links out from webmaster tools and they are mainly directories or webstat websites like the ones below | siteinfo.org.uk deperu.com alestat.com domaintools.com detroitwebdirectory.com ukdata.com stuffgate.com | We’ve also just launched a new initiative where we will be producing totally new and good quality content 4-5 times a week and many of these new links are pointing to that page which looks very suspicious to me. Does this look like negative Seo to anyone? I’ve read a lot about the disavow tool and it seems people’s opinions are split on when to use it so I was wondering if anyone had any advice on whether to use it or not? It’s easy for me to identify what these new links are, yet some of them have decent DA so will they do any harm anyway? I’ve also checked the referring anchors on Ahrefs and now over 50% of my anchor term cloud are totally unrelated terms to my site and this has happened over the last week which also worries me. I haven’t seen any negative impact on rankings yet but if this carries on it will destroy my link profile. So would it be wise to disavow all these links as they come through or wait to see if they actually have an impact? It should be obvious to Google that there has been a huge spike in links so then the question is would they be ignored or will I be penalised. Any ideas? Thanks in advance Richard
White Hat / Black Hat SEO | | Rich_9950 -
Cutting off the bad link juice
Hello, I have noticed that there is plenty of old low quality links linking to many of the landing pages. I would like to cut them off and start again. Would it be ok to do the following?: 1. create new URLs (domain is quite string and new pages are ranking good and better than the affected old landing pages) and add the old content there 2. 302 redirect old landing pages to the new ones 3. put "no index" tag on the old URLs (maybe even "no index no follow"?)or it wouldn't work? Thanks in advance
White Hat / Black Hat SEO | | ThinkingJuice0 -
How to recognize Panda, Penguin or Unnatural Links Penalty ?
Hey guys, today I've received below message from Google, but I'm confused that there NO such message in WMT ?!??!?!?! I've login /out few times and situation is still same ?!?!? Still Nothing there ? Anybody had same issue ? Do I need to fill reconsideration request ? Pleased to hear back from you guys. NikoT Google Webmaster Tools notice of detected unnatural links to .com/ Dear site owner or webmaster of , We've detected that some of your site's pages may be using techniques that are outside Google's Webmaster Guidelines. Specifically, look for possibly artificial or unnatural links pointing to your site that could be intended to manipulate PageRank. Examples of unnatural linking could include buying links to pass PageRank or participating in link schemes. We encourage you to make changes to your site so that it meets our quality guidelines. Once you've made these changes, please submit your site for reconsideration in Google's search results. If you find unnatural links to your site that you are unable to control or remove, please provide the details in your reconsideration request. If you have any questions about how to resolve this issue, please see our Webmaster Help Forum for support. Sincerely, Google Search Quality Team
White Hat / Black Hat SEO | | NikoT0 -
Internal Link Structure
Hello Everyone, I'd be grateful for a little feedback please; This is my site, the home page
White Hat / Black Hat SEO | | TwoPints
of which is targeting the phrase jobs in **** (I'm sure you can fill i the gap
:)) I've made a few changes recently which has included having the
Contract jobs in **** | Permanent Jobs in **** | Temporary Jobs in **** & Today’s
jobs in **** links added to the homepage... Perhaps foolishly and impatiently, I did all of these at the
same time, whilst also changing the sites internal link structure, specifically
for all links to the homepage, which previously were like <a<br>href="/">Home and have now been changed to <a<br>href="/">jobs in ****</a<br></a<br> Meaning that I have 4500 internal links with the anchor text
'jobs in ****' But rather than seeing an improvement n my SERPs ranking, I have
gone from page 2 of Google to page 6, and falling...... Apart from being inpatient, what have I done wrong? Many thanks0 -
Do Friends Let Friends Sell Links?
I have a friend with a site that has a lot of content. Some of that content has affiliate links with no follows to affiliate urls. Those pages also have a disclosure on them about the affiliate relationship. Now, he's talking about taking some of the existing under-performing affiliate links and renting them out to another site that wants them for the link juice. He says he'd have an on-page disclosure, a display ad for the advertiser on the page and something in the text like "you might check out our advertiser..." and then some keyword targeted link. He was asking me how risky I thought this is for him and really I don't know.Do you think Google would find this and s**t a chicken over it? I really don't know, given that I see really blatant undisclosed rented links all the time.Of course, my easy answer to him is "don't do it," but it does make me wonder how risky that is. Also, is that a realistic site-wide penalty kind of thing or it just doesn't pass any link juice to the advertiser kind of thing? So, I'm posting here for others to weigh in on. Thanks!
White Hat / Black Hat SEO | | 945010 -
Which of these elements are good / bad link building practices?
Hi, I need some help. I recently got some help with an seo project from a contractor. He did 50 directory submissions and 50 article submissions. I got good results, going up about 20 places (still a long way to the first page!) on google.co.uk on a tough key word Since this project I learned article marketing is not cool. So I am wondering about what I should do next. The contractor has proposed a new bigger project consisting of the elements listed below. I don’t know which of these elements are ok and which aren’t. If they are not ok are they: 1) a waste of time or 2) something I could get penalized for? Let me know what you think?? Thanks, Andrew 100 ARTICLE SUBMISSIONS [APPROVED ARTICLES] -> 1 article submitted to 100 article directories 50 PRESS RELEASE SUBMISSIONS [APPROVED & SCREENSHOTS]-> 1 PR writing & submissions to top 50 PR distribution sites each 150 PRIVATE BLOGS SUBMISSION [APPROVED ARTICLES] -> 1 article submitted to 150 private blogs submission 100 WEBSITE DIRECTORY SUBMISSION -> 1 url (home page) submitted to 100 top free web directories 50 SOCIAL BOOKMARKING [CONFIRMED LINKS] -> 1 url of site submitted to top 50 social bookmarking websites 40 PROFILE BACK-LINKS [CONFIRMED LINKS] -> 1-3 url's of site submitted and create 40 profile websites 50 SEARCH ENGINES -> submission to all the major search engines 20 NEWS WEBSITES -> Ping all links from reports to news websites
White Hat / Black Hat SEO | | fleurya0