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.
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.
- Copy your shortcode from its source.
- Then, go to your OptinMonster campaign in the OptinMonster builder.
- Select the Add Blocks button then click and drag an HTML element into your campaign.
- 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.
- Once you are satisfied with your campaign’s appearance and settings, set the campaign Status to Live and then Save your campaign.
- Next, navigate to the OptinMonster plugin from the admin of your WordPress site.
- 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.
- 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.