Home » Monetization » Add Affiliate Links to WordPress: Effortless Integration

Add Affiliate Links to WordPress: Effortless Integration

Adding affiliate links to WordPress is a straightforward process. We will walk you through each process step, from choosing an affiliate program to implementing your affiliate links.

The current article is "9.3. Add Affiliate Links to WordPress" of our Complete SEO Guide Box.
Previous Article: 9.2. Affiliate Marketing Monetization. Next Article: 9.4. Passive Income Long-Term Plan

Before continuing, you should read the previous article about Affiliate Marketing Monetization.

Select an Affiliate Program

To add affiliate links to WordPress, join an affiliate program that resonates with your website’s niche and audience. Once approved for an affiliate program, you’ll receive a unique affiliate link in your affiliate dashboard. This link tracks conversions and credits you for referrals. Copy this long URL with tracking parameters. We will use it in Posts and other places on the site.

Add Affiliate Links to a Post or Page

Adding affiliate links to WordPress posts or pages involves hyperlinking text or images and using shortcodes. We’ll explain both.

Hyperlinking Text or Images

Create/Edit a Post/Page: In your WordPress dashboard, Select the “Posts” or “Pages” tab, create a new post/page, or edit the one that already exists.

Insert Text or Image: Add the text or image where you want the affiliate link to appear.

Highlight and Hyperlink: Highlight your text or select the image, then click the “Insert/edit link” button (typically a chain link icon) in the editor toolbar.

Paste the Affiliate Link: In the “URL” field, paste your affiliate link and hit [Enter].

Advanced link options: Click the link, click the “Edit” button (pencil icon), expand “Advanced”, then check the boxes against:
[V] Open in new tab
[V] This is a sponsored link or advert (mark as sponsored)
Click [Save].

Publish or Update: Save changes by clicking “Publish” or “Update.”

Using Shortcodes (Advanced Method)

Affiliate marketing plugins, like ThirstyAffiliates and Pretty Links, let you create short, clean URLs (known as “cloaked” links) for your affiliate links using WordPress shortcodes. In most cases, shortcodes in Affiliate plugins are a premium feature. Google doesn’t like cloaked links, so if you use these plugins and there is a feature not to cloak the links, use it.

Add Your Affiliate Link: Follow the plugin instructions to add your affiliate link and generate a shortcode.

Insert the Shortcode: Copy and paste the generated shortcode into the post or page where you want the affiliate link.

Publish or Update: Save changes by clicking “Publish” or “Update.”

Aside from adding affiliate links within the content of your posts or pages, you can also add them as sidebar widgets. This can be a valuable strategy for promoting specific affiliate offers, as the sidebar often remains visible regardless of which page or post the visitor is viewing.

To add affiliate links as sidebar widgets, navigate to the left side menu to your WordPress’s [Appearance] section and select [Widgets]. A better way in [Appearance] to navigate to the [Customize] section, then inside Customizer on the left side menu, click [Widgets], then click the [Main Sidebar] (or you can click the pencil button on the Sidebar itself), of course, you need to be on the page that contains a sidebar. This way, you should see your changes at the same time.

The Idea

You can drag and drop widgets, such as “Text” or “Custom HTML,” to your sidebar area. In the chosen widget, paste your affiliate link (either the original link or the link created through ThirstyAffiliates or Pretty Links) and add a call-to-action or an image to encourage users to click the link.

Save your changes, and the affiliate link will be shown in the sidebar, providing a constant, visible opportunity for users to engage with your affiliate offers. This strategy can help increase exposure to your affiliate links and potentially boost your affiliate revenue.

Promoting affiliate offers using eye-catching images can be a highly effective strategy. Here’s how you can add an affiliate link as an image to your WordPress site’s sidebar widget while you’re already in the [Widgets] editing menu:

Add a Block: On the left pane of the widget editor, click the “+” button to add a new block to your sidebar area.

Select Image Block: From the list of available blocks, select the “Image” block.

Upload an Image: Click the “Upload” within the Image block to upload the image you’d like to use for promoting your affiliate offer. Don’t forget to optimize this image with the RIOT program before uploading.

Add Your Affiliate Link: Once the image is uploaded, click on the image to bring up the linking options. Click on “Add link,” paste your affiliate link into the provided field, and then click the downward arrow icon to access additional settings.

Open in New Tab: Set the “Open in new tab” option to “On.” This ensures that when a user clicks on the image, the linked page will open in a new tab, keeping your website open in the background.

Add Link Rel Attributes: In the “LINK REL” field, type

noreferrer noopener sponsored

These attributes help improve security, indicate that the link is sponsored, and ensure proper link handling by search engines.

Apply Settings: Save your settings by clicking the “Apply” button.

Adjust Image Size (If Necessary): If you need to adjust the banner image size, one of the approaches is to change the ratio between the content area and the sidebar in your theme’s settings. Please note that this will affect all content in the sidebar.

Here’s how you can add an affiliate link as text within a paragraph to your WordPress site’s sidebar widget while you’re already in the [Widgets] editing menu:

Add a Block: On the left pane of the widget editor, click the “+” button to add a new block to your sidebar area.

Select Paragraph Block: From the list of available blocks, choose the “Paragraph” block.

Add Your Promotion Text: Type the promotional text you want to display in the sidebar into the Paragraph block.

Create a Text Link: Highlight the portion of the text that you want to convert into a link, and then click on the linking icon to make it a link.

Insert Your Affiliate Link: Paste your affiliate link into the provided field and enable the “Open in a new tab” option. This ensures that when a user clicks on the link, the affiliate page will open in a new tab, leaving your website open in the background.

Edit the Link Attributes in HTML: In the paragraph editing bar, find the menu on the right side and click it. Choose “Edit in HTML” from the menu. In the HTML code, locate the “rel” attribute within the anchor tag (<a>) and replace its value with “noreferrer noopener sponsored.” Your code should look like this:

<a rel="noreferrer noopener nofollow sponsored" href="https://www.youraffiliate.com/promotion" target="_blank">Your Affiliate Promotion</a>

Return to Visual Editing: Click “Edit visually” to switch back to the visual editor.

Position the Widget: Place the widget in the desired location within the sidebar by clicking the “up” or “down” arrow in the paragraph editing menu.

Publish: Once you’re satisfied with the placement and appearance of your text link, click [Publish] on top of the left menu bar to save your changes and make the widget live on your site.

Adding an affiliate link as text after the first paragraph of your posts is an excellent way to promote affiliate offers without disrupting the flow of your content. Here’s how you can achieve this using the WPCode Lite plugin:

Install the WPCode Lite Plugin: In the WP dashboard, on the left side menu bar, click the [Plugins] section, search for “WPCode Lite” by WPCode, and install and activate the plugin.

Access Code Snippets: In your WordPress dashboard, on the left side menu, click [Code Snippets], and then click on secondary [Code snippets].

Edit the Code Snippet: Locate the code snippet titled “Display a message after the 1st paragraph of posts” and click “Edit.”

Add Your Affiliate Text: In the editing interface, enter your marketing affiliate text in the designated area. At the beginning of your text, you can add the prefix “Affiliate:”, to show the user what this text is about. You may change text styling to stand out from the regular content.

Add Your Affiliate Link: On the right side of the text box, click “Text.” Select the portion of text that you want to convert into an affiliate link and add a link to it. In the “URL” field, paste your affiliate URL and check the “Open in New tab” box. Now, edit the link so it looks like this:

<a href="https://www.example.com" target="_blank" rel="noreferrer noopener sponsored">Click Here</a>

Replace “https://www.example.com” with your affiliate URL and “Click Here” with your chosen anchor text. Leave the rest of the code unchanged.

Configure Insertion Settings: Scroll down to the “Insertion” section. Set “Insert Method” to [Autoinsert], “Location” to [Insert After Paragraph], and “after paragraph number” to 1.

Set Device Type: In the “Device Type” section, select [Any device type].

Enable Smart Conditional Logic: In the “Smart Conditional Logic” section, enable logic by turning it “On.” Set “Conditions” to [Hide] and click [+ Add new group]. Then select [Post type], [Is], and [Pages]. This setting ensures that the affiliate text does not appear on static pages.

Activate and Update: In the top right corner of the editing interface, set the snippet to “Active” and click [Update].

Clear Caches and Verify: Release all caching plugins and check that your static pages do not display the affiliate link while your posts do.

ThirstyAffiliates and Pretty Links are both affiliate link management plugins for WordPress. These plugins fall under tools that help you organize, cloak, and track your affiliate links. The primary purpose of these plugins is to simplify the process of managing and optimizing your affiliate links on your WordPress site.

Cloaking, in this context, refers to creating clean and easy-to-read URLs that replace the long, complex affiliate links provided by affiliate programs. This enhances the appearance of your affiliate links and helps track your links’ performance. As we stated before, link cloaking is against Google policy.

These plugins allow you to create custom short links, automate the insertion of affiliate links, and even track the clicks on your affiliate links. In essence, ThirstyAffiliates and Pretty Links are comprehensive solutions for handling affiliate links, making adding affiliate links to WordPress and monitoring your affiliate marketing efforts easier.

Both ThirstyAffiliates and Pretty Links have tracking enabled by default. Meaning they use cookies on the user’s computer to track statistics. In this case, you must add their tracking cookie in the Privacy Policy and Cookie Policy and a Cookie Consent banner to your site. You can also turn off the default plugin’s analytics and use only Plausible Analytics, which doesn’t use cookies. In this case, you don’t need a Cookie Consent banner or change your policies.

Premium versions of both ThirstyAffiliates and Pretty Links allow shortcode usage and automatic keyword linking.

Of course, you need only one Affiliate Link Management WordPress plugin.

Setting Up ThirstyAffiliates

To install the ThirstyAffiliates plugin, in the [Plugins] tab, find: ThirstyAffiliates – Affiliate Links, Link Branding, Link Tracking & Marketing Plugin By Caseproof.
Please install and activate it.

Access ThirstyAffiliates Settings. In your WordPress Admin area, navigate to [ThirstyAffiliates] on the left sidebar and click the [Settings] tab.

[General] Settings:

Don’t cache 301 redirects: Leave this box unchecked. Affiliate links don’t need caching as they can change, and avoiding cache ensures you’re always serving the most current version of the link.
Disable IP address collection: Check this box to avoid collecting users’ IP addresses in line with GDPR.
Disable browser/device data collection: Check this box for privacy considerations.
Click [Save Changes] to save your general settings.

Link Prefix: Set this to “offer”. It’s short and makes it straightforward to users that the link is an affiliate offer.
Link Redirect Type (server side redirects): Select “301 Permanent” as the most SEO-friendly option.
Use no follow on links? (server side redirects): Select “Yes” to indicate to search engines that these are paid links.
Open links in new window: Choose “Yes” to improve user experience by keeping your website open.
Pass query strings to destination url: Select “No.”
Disable ThirstyAffiliates CSS classes: Check this box to avoid adding unnecessary CSS to your site.
Disable title attribute on link insertion: Check this box to prevent automatic title attribute generation.
Click [Save Changes].

[Modules] Settings:

Statistics: Leave this box unchecked to avoid setting third-party cookies on users’ computers. You can track link performance with an external analytics tool like Plausible Analytics.
Link Fixer: Check this box to ensure all affiliate links are correctly formatted and working.
Uncloak Links: Check this box to serve uncloaked links.
Click [Save Changes].

By following this guide, you’ll have ThirstyAffiliates set up in a way that’s both user-friendly and compliant with privacy regulations. The plugin will now be ready to help you effectively manage and optimize your affiliate links.

You can add affiliate links to WordPress with Pretty Links.
To install the Pretty Links plugin, in the [Plugins] tab, find: Pretty Links – Affiliate Links, Link Branding, Link Tracking & Marketing Plugin By Pretty Links.
Please install and activate it.

Access Pretty Links Settings. In your WordPress Admin area, navigate to [Pretty Links] on the left sidebar and click the [Options] tab.

Redirection: Set this to “301 (Permanent),” as 301 redirects are SEO-friendly and indicate to search engines that the link has moved permanently to a new location.

Enable Tracking: Leave this box unchecked. While tracking provides valuable insights into the performance of your affiliate links, enabling this option may create cookies, which could require you to implement a cookie consent plugin for GDPR compliance. Instead, you can use external tools like Plausible Analytics to track your link performance without setting cookies.

Enable No Follow: Leave this box unchecked. The “No Follow” attribute tells search engines there is no need to pass “link juice” to the linked website, which is typically recommended for affiliate links. However, the following setting provides a more specific way to handle this.

Enable Sponsored: Check this box. When you mark links as “Sponsored,” it tells search engines that you received compensation for including the link, which is more specific than the “No Follow” attribute. By setting this option, you don’t need to enable the “No Follow” option.

Enable Permalink Fix: Check this box to ensure your affiliate links are formatted correctly and function as expected.

Click [Update] to save your link settings.

By following this guide, you’ll have Pretty Links set up in a manner that optimizes your affiliate links for search engines and avoids potential privacy issues. With the plugin properly configured, you’ll be ready to manage your affiliate links more efficiently and effectively.

Conclusion

Adding affiliate links to WordPress can seem complex. However, with this guide, you’ll find it an easy and effective way to monetize your site. By selecting the right affiliate program, retrieving your unique link, and following these steps, you can generate income through your website. Remember to disclose your affiliate links and ensure compliance with your chosen affiliate program’s terms and conditions.

The current article is "9.3. Add Affiliate Links to WordPress" of our Complete SEO Guide Box.
Previous Article: 9.2. Affiliate Marketing Monetization. Next Article: 9.4. Passive Income Long-Term Plan

 

If you find any mistakes or have ideas for improvement, please follow the email on the Contact page.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.