How to Use WordPress Shortcodes with OptinMonster

OptinMonster makes it easy to use Shortcodes from your WordPress plugins or theme with our templated campaigns.

In this article, you’ll learn how to add WordPress shortcodes to OptinMonster campaigns..

Before You Start

Here are some things to know before you begin:

  • The OptinMonster WordPress plugin is required to use WordPress shortcodes. You will need to install and activate the OptinMonster WordPress plugin before following these directions.

Add Shortcode

If you would like to further customize the appearance, content, and functionality of your OptinMonster campaign, you can do so using shortcodes from other plugins on your WordPress site.

To add a shortcode to your OptinMonster campaign, follow the steps below.

In this example, we’ll add a WPForms shortcode to an OptinMonster campaign. We can copy the WPForms shortcode for our form by clicking the Embed button in the form builder of WPForms plugin.
  1. Copy your shortcode from its source.
  2. Then, go to your OptinMonster campaign in the OptinMonster builder.
  3. Select the Add Blocks button then click and drag an HTML element into your campaign.
  4. Paste the shortcode you previously copied into the HTML editor box.
    Note: The Campaign Builder will not show you a live preview of the parsed shortcode. Don’t worry! It will still appear correctly on your site.
  5. Once you are satisfied with your campaign’s appearance and settings, set the campaign Status to Live and then Save your campaign.
  6. Next, navigate to the OptinMonster plugin from the admin of your WordPress site.
  7. Select the Refresh Campaigns button sync the Live campaign to your site.
    This step must be done every time you add, edit or remove a shortcode from any campaign.
  8. The campaign should now appear on your site for you to test.


Will my shortcode work if I’m manually embedding the campaign or using Google Tag Manager?

If you’re manually adding the embed code or using Google Tag Manager instead of the OptinMonster API plugin for WordPress, the shortcodes will not be parsed in your campaigns. If you want to use shortcodes in your campaigns, you’ll need to use the OptinMonster API plugin to control where the campaigns appear on your site instead.

Do I need to use both the WordPress Plugin and the Display Rules?

Learn how our WordPress Plugin and Display Rules work together.