How can I nofollow my affiliate links?
-
I have a lot of affiliate links and I need to find an efficient way to nofollow them. I have over 500 blog posts and most have an affiliate link. I use Wordpress and Genesis. Any advice?
-
That would take forever! Seriously! But I have no programming skills whatsoever.
-
I used http://wordpress.org/plugins/nofollow-for-external-link/ or SEO Smart Links before just to do mass no follow. For affiliate sites that i didnt want to bother with anymore.
-
The other way is a manual way where you have to get in to every post and add rel = 'nofollow' on each affiliate link but if you have programming skills and can create a PHP script then go for the idea suggested above!
-
You can either create a script to go over the posts, recognize some pattern on the links and add the nofollow attribute, or edit post by post adding the nofollow.
As you mentioned Wordpress, a PHP script should do the work very fast and easily using an html DOM parser.
Here's an example: http://simplehtmldom.sourceforge.net/
and run something like:
foreach ($html->find('a') as $a) {
if(!checkUrl($a->href)) {
$a->rel = 'nofollow';
}
}checkUrl is a function you should write to recognize those affiliates links...
Hope that helps!
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
-
Site Wide Links
Howdy Moz! So our agency has been around for long enough to have a few sites we've built that have our credit in their footer resulting in a site wide link. Mostly just our name. We've heard that Google does not particularly like site wide links, should we go through and remove some of these old links?
On-Page Optimization | | wearehappymedia0 -
Too Many on page links on my homepage question?
Question, on moz analytics, for my homepage, I've gotten the " Too many on page links" notification every crawl. I've always ignored it because i didnt think it affected ranking or anything really. The on page links on the bottom of our homepage are landing pages. Most users reach those pages by searching those specific pages on google. We just decided to put them on the bottom of our page for unknown reasons. My question is, should i remove the landing pages on the bottom of our homepage? WIll it improve search rankings for my homepage? if i do remove them, should i put the landing pages on another page besides the homepage? Does google index my website better without the on page links on my homepage? My website is- prestigeluxuryrentals.com
On-Page Optimization | | prestigeluxuryrentals.com0 -
Can we use internal no-follow links without negatively affecting rankings
we are creating a site structure for a travel website. the site homepage has a top navigation bar with 8 top level links and a total link count of 33 links in this (within menus). There are also 10 footer and ad-hoc links As this top navigation bar is a site-wide navigation, when entering s specific "travel destination" page, the "travel destination" page has its own contextual links and reference links, making the total inks on the destination page approx 107. do you think its ok to make all links in the top navigation bar no follow on all pages except the homepage? how would you approach this to create less links to maintain effective link-juice flow to required pages
On-Page Optimization | | Direct_Ram0 -
Alt text / internal linking
Hi everyone A question about best practice when linking from pictures on our homepage - hirespace.com We have an option of using divs with background images (nicer in terms of design) but it means that we can't use anchor text or alt text to show Google what these internal links are about. The other option is to use images which do not allow us as much flexibility in terms of CSS but would allow us to use alt text. There is also an opinion that we should have separate text links at the bottom of the homepage to get the anchor page in. What is best practice in this situation - is alt text worth sacrificing some CSS flexibility for? How important is anchor/alt text for internal linking? Thanks guys.
On-Page Optimization | | HireSpace0 -
Internal keyword linking - short or long string
I've seen a couple of people leave comments about keyword linking being too specific. If I"m doing a lot of internal keyword linking and I want to rank well for 'widgets', is it better that most of the links just use the word 'widgets' or should some of the links have more words in them. ie: 'red and blue widgets' - 'buy these widgets online' etc.
On-Page Optimization | | sparrowdog0 -
Are My footer links bad?
I started working here recently, they said the footer links were to help with navigation of their most popular products. I am curious after reading http://www.seomoz.org/blog/internal-linking-strategies-for-2012-and-beyond if having these footer links could hurt the ranking of those key words after the penguin update. I am looking more into the analytics, and have not seen a negative impact yet.
On-Page Optimization | | DoRM0 -
Alternatives for having less then 100 links per page
Guys, I'm aware of the recomendation of having <100 links per page. The thing is I'm running a vacation rental website (my clients pay me to advertise their properties on my website). We use an AJAX interface with pagination to show the properties. So I have cities that have +400 properties on them... the pagination works fine but google can't crawl trough it (there is a google doc about making ajax systems crawlable, but that would invove a huge rewrite of our code and I dont understand how it helps the SEO). So my question is: what do I do to mantain each property having at least one link pointing to them at the same time that I keep the # of links in each page <100 ? Any suggestions ?
On-Page Optimization | | pqdbr0 -
Links to subfolders
Hi everyone, I would like to know your opinion on this. Do you feel like optimizing, especially pointing links to a subfolder, e.g. www.domain.com/en/ (english language), should be the same as doing that for the main URL (another language)? That said, do you think all the domain will benefit from anchors to subfolders? Thanks a lot!
On-Page Optimization | | SEOpt0