Blocks is a new free add-on for AffiliateWP that adds (yep, you guessed it) blocks. It provides an improved experience over shortcodes when using the WordPress block editor.

Shortcodes are neat (and aren’t going anywhere) but blocks can provide a visual representation for specific elements when working with AffiliateWP. As an example, instead of seeing the Affiliate Registration shortcode, you’ll see the entire form right within the block editor. Based on AffiliateWP’s settings, it will show or hide specific fields.

In total there are ten blocks, one for each of the shortcodes AffiliateWP currently provides.

Showing an affiliate their referral URL

Have you ever used the Affiliate Referral URL shortcode to display a referral URL to the logged in affiliate?

By using the Affiliate Referral URL block, you’ll now see how the referral URL will appear to affiliates when they view the page. You’ll no longer need to remember all the different shortcode parameters like pretty, format and url.

Just insert the block and configure the block’s options from the sidebar. As you update each option, the preview will instantly update within the editor.

If the user editing the page also happens to be an affiliate, they’ll see their real affiliate ID or username.

The WordPress editor showing the Affiliate Referral URL block
The Affiliate Referral URL block

Adding the conversion script

If you’re not using an integration we support, you may be familiar with placing the conversion script shortcode on your website’s “success” page.

The shortcode has a whopping seven options to configure. Though there’s no block preview (it’s just a script after all), a block makes it simple to completely configure the shortcode without making any errors:

The WordPress editor showing the Affiliate Conversion Script block
The Affiliate Conversion Script block

Restricting content to affiliates (or non affiliates)

Any block added inside the Affiliate Content block will only be visible to logged in (and active) affiliates. There’s also a block for doing the opposite, only showing content to non affiliates.

When any block within the Affiliate Content block is focused, it will show a notice, reminding you who the block’s intended audience is.

The WordPress editor showing the Affiliate Content block
The Affiliate Content block

Give it a spin!

We’re excited at the possibilities blocks allow and we can’t wait to hear any and all feedback from you. There’s certainly a lot more we can do to further improve the experience.

Blocks is available now for all AffiliateWP users, and can be downloaded from within your WordPress admin, via the add-on page, or from the plugin page on


Andrew Munro

About the author: Andrew Munro co-founded AffiliateWP in early 2014. His trusty treadmill desk allows him to write code at an incredible 3 mph, making him the fastest developer around.

One comment

Leave a Reply

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