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
-
Should I add canonical links to pages that are redirected?
Hello! I am a little confused concerning canonical links. I have several URLs that all access my page, but I redirect them all. A lot of places I am told to redirect them or use canonicals. Other places, I read that I should always use canonicals. What is the right way for me? If I should use canonicals as well as redirects, which links should I do this on? I redirect my pages like this: http to https:
On-Page Optimization | | hermanok
http://example.com -> https://example.com www to non-www:
https://www.example.com -> https://example.com Remove trailing slashes
https://example.com/ -> https://example.com Would-be 404-requests to index.php?p=$1
https://example.com/home -> https://example.com/index.php?p=home ( show as https://example.com/home ) Example:
http://www.example.com/home/ -> http://www.example.com/home/ -> https://example.com/home/ -> https://example.com/home -> https://example.com/index.php?p=home ( shows as https://example.com/home ) Thank you!0 -
Internal linking
Hi Guy's, Whats the best way to set internal links on your website: 1. href=: /page/
On-Page Optimization | | Happy-SEO
2. href=: https://domain.com/page/ Thanks!0 -
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 -
Reducing number crawl-able links?
Hello, I just like to ask for best practice when it comes to reduce number of internal links on a site with a mega menu. Since the mega menu lists all categories and all their subcategories it creates a problem when all categories are linking to all categories directly.. Would the method below reduce the number of links and preventing the link juice flowing directly from category to category? [(link built with JavaScript and the html5 "data-" attribute) Thinking of using these links to categories in the menu not directly below the parent category.](#)
On-Page Optimization | | AJPro0 -
Nofollow in global navigation?
Currently planning our site architecture and little confused over the management of our global navigation To benefit from the maximum link juice to our 50-100 most important pages we are going to incorporate links to these from our homepage as part of the global navigation. Now I understand we want nice, flat architecture; however; on these sub pages we may one day want to place another 100 of so links on these to another category level. The problem I see arising is if we already have a bunch of links as part of our global navigation we are going to dilute the links on any sub category pages. Now Im guessing the solution to is nofollow the global navigation on all pages other than the homepage? or do the bots recognize a global navigation as such and is able to handle this issue already? Thanks for everyones help.
On-Page Optimization | | jg1000 -
Do anchor links pointing to bottom/top of page count as link?
As the title says: Do anchor links pointing to bottom/top of page count as link? This page: http://www.betxpert.com/forum/bookmakere/vis/ladbrokes-kommentar I has over 300 links, but I don't see that many links. Is it the "#15" and the top/bottom of page anchors that count? Is this harmful in terms of link juice? -Rasmus
On-Page Optimization | | rasmusbang0 -
More than 100 internal links from a page
Hi, we have been developing our new site and improving the internal linking for 2 reasons, 1 to improve spidering and 2 to up sell more to customers. The error reports from SEOMoz are showing our biggest problem is too many internal links from 2000+ pages. How much of an impact does it have by having say 180 internal links compared to say 99 on a page? Our website has been moving up the SERPs so should i worry about it or should I ignore the warnings and continue with the menu system and internal linking we have in place already? Thanks
On-Page Optimization | | PottyScotty0 -
Image alt attribute vs. plain text in link?
I'm building a product category browsing page for a high-falutin' jewelry retailer where we display only product photos linking to individual product pages, without any text in the links. From an SEO and link-juice-passing perspective, is it most effective to embed the product titles as the alt attribute in each image, or to leave alt="" and use text substitutions (i.e. an inner which is css'd to display: none) within the <a>to help search engines accept my product titles as the link text with the most credibility?</a>
On-Page Optimization | | cadenzajon0