How to create a subscription form in WordPress with Mailrelay: 3 ways

With the plugin, by pasting the code or as a pop-up: choose the way that best fits your website and start capturing subscribers today

Jose Argudo , CMO @ Mailrelay

To add a Mailrelay form to WordPress you have three options: the official plugin, pasting the code into an HTML block or showing it as a pop-up.

None of them requires coding. Here’s how to do it step by step, when each one makes sense and what happens when someone subscribes.

Before you start: create your form in Mailrelay

All three options use a form you create beforehand in Mailrelay, under Subscribers > Signup forms.

There you choose the fields, the groups subscribers join and the design.

Also turn on the Captcha and the honeypot field, which prevent fake sign-ups.

You’ll find the step-by-step guide in how to create a subscription form in Mailrelay.

The 3 ways to add the form to WordPress

MethodNeeds a pluginDifficultyWhen to use it
Official Mailrelay pluginYes, the Mailrelay oneVery easyIf you use the block editor and also want to sync your users
Embedded codeNoEasyIf you don’t want to install plugins or you use Elementor or another page builder
Pop-upNoEasyIf you want the form to appear in a pop-up window
Infographic: 3 ways to add your subscription form to WordPress without coding, with the official plugin, the embedded code or as a pop-up

Create your subscription form for free

Forms, pop-ups and landing pages are included in Mailrelay’s free account too.

Option 1: with the official Mailrelay plugin

The Mailrelay plugin for WordPress is free and available in the official WordPress plugin directory.

As well as displaying your forms, it syncs your website’s users with Mailrelay groups.

  1. Install the plugin: in WordPress, go to Plugins > Add New, search for “Mailrelay”, install it and activate it.
  2. Create an API key in Mailrelay: in your account, go to Settings > API keys and generate a key.
  3. Connect your account: in the Mailrelay > Authentication menu in WordPress, enter your account name (it’s in the welcome email) and the API key.
  4. Add the form: edit the page or post where you want it, add the Mailrelay forms block and choose the form.
  5. Publish and check: open the page and make a test subscription.

The plugin has more features you may find useful:

  • User sync: users registered on your WordPress site are added to one or more Mailrelay groups.
  • WPForms: if you already use this form plugin, you can connect it to Mailrelay.
  • WooCommerce: sync your online store’s products and carts with Mailrelay.

Option 2: paste the form code

If you’d rather not install plugins, copy the form code and paste it into your website.

How to get the code in Mailrelay:

  1. Go to Subscribers > Signup forms and choose the form.
  2. Click Generate code.
  3. Under Embedded form, click View code and copy it.
Options for a subscription form in Mailrelay with the Generate code button

The code is made up of an iframe and a script. You need to paste both parts together.

Mailrelay embedded form code, with the iframe and the script to paste into your website

How to paste it into WordPress:

  • In a page or post: add a Custom HTML block where you want the form and paste the code.
  • In the sidebar or footer: in Appearance > Widgets or in the site editor, add a Custom HTML block in the area you want.
  • With Elementor: drag the HTML widget to the section where you want the form and paste the code.

The form’s look doesn’t depend on your theme: you change the colors and the button in the form’s Design tab in Mailrelay.

Option 3: show the form as a pop-up

The pop-up opens the form in a window over your website. It’s more visible, but it can also be annoying if it appears too soon.

  1. In Generate code, click View code in the Pop-up form section.
  2. Choose when it opens: when a button is clicked, after a few seconds or when the visitor tries to leave the page.
  3. Copy the code after choosing the option, because it changes with each one.
  4. Paste it into a Custom HTML block on the page, or into a widget area if you want it to appear across your whole website.
Mailrelay pop-up form code with the option for when it opens

If you choose the button, you can change its text, which is “Subscribe” by default.

The leave-the-page option may not work in every browser or on mobile.

Other options: the form URL and the landing page

Each form has its own URL, which opens a page with just the form.

You can share it on social media, in your email signature or in a QR code.

If you want a full page for a campaign, with a headline, benefits and a form, create a sign-up landing page with Mailrelay’s editor.

Where to place the form on your website

  • At the end of each blog post: readers who’ve made it to the end are the most interested.
  • In the footer: always visible and unobtrusive.
  • In the sidebar: useful on blogs, although on mobile it usually ends up at the bottom.
  • On a page of its own: link to it from the menu with text like “Newsletter”.
  • As a pop-up: better with a button or after a few seconds of reading than as soon as the visitor arrives.

And pay attention to the copy: say what you’ll send and how often. You’ll find ideas in how to write your subscription form.

What happens when someone subscribes

  1. Confirmation: the subscriber receives an email to confirm their sign-up, the double opt-in. You can edit it in Settings > System emails.
  2. Groups: they join the groups you chose when you created the form.
  3. Welcome: if you create an automation that starts when someone signs up through a form, they receive your welcome email.
  4. Tracking: in the form’s Conversions tab you can see each sign-up with its date, city and browser.
Infographic: from the form to your list in 4 steps (they subscribe on your website, confirm their email, join your groups and receive the welcome email)

That way you know which form brings you the most subscribers and where it’s worth placing it.

Welcome every new subscriber

An automation sends the welcome email as soon as someone signs up through your form.

How Mailrelay Helps You

  • Subscription forms with custom fields, privacy policy acceptance, Captcha and honeypot.
  • Official WordPress plugin with a forms block, user sync, WPForms and WooCommerce.
  • Embedded form, pop-up, its own URL and landing pages, with no coding.
  • Double opt-in and welcome automations.
  • Conversions per form to measure what works.

The free account lets you send up to 80,000 emails a month to 20,000 contacts.

Turn your visitors into subscribers

Free account: up to 80,000 emails a month to 20,000 contacts, with human support.

Frequently asked questions about the WordPress subscription form

Do I need a plugin to add a Mailrelay form to WordPress?

No. You can paste the form code into a Custom HTML block. The official plugin makes it easier and adds user sync.

Does it work with Elementor?

Yes. Paste the form code into Elementor’s HTML widget, in the section where you want it to appear.

Can I change the form’s colors?

Yes, in the form’s Design tab in Mailrelay. The form doesn’t pick up your theme’s styles.

How do I prevent fake subscriptions?

Turn on the Captcha and the honeypot field in the form. And use double opt-in, which confirms each address.

Where can I see how many people have subscribed from my website?

In each form’s Conversions tab, in Mailrelay.

Jose Argudo, CMO at Mailrelay

Jose Argudo

CMO at Mailrelay. Writes about email marketing, copywriting and conversion for small businesses and entrepreneurs.

More articles by Jose · LinkedIn