How to Add Subscription box to website
Email Subscribers offers you a subscription form which you can customize and show to the visitors/users in the widget area using a widget, theme files using a PHP snippet or wherever you want using the shortcode. Visitors can simply enter their email address & name (if enabled).
Adding a widget
Note: Since Email Subscribers version 4.5.5, we have included the step of adding a form widget as a part of onboarding process in the plugin. You can skip this part if the form is already added as a widget.
If your theme has a sidebar you can find the subscription form widget under Appearance → Widgets. To add a widget,
- Go to WordPress Dashboard → Appearance → Widgets
- Drag and drop the Email Subscribers widget or add it to a support widget area
After adding the widget, you can give it a name and select the form (in case you have more than one subscription forms) to display in the widget.
You can edit an existing form or create a new one under Email Subscribers → Forms and use the given shortcode to show the subscription form anywhere on your website.
Alternatively, you can integrate Email Subscribers form with on-site notifications created using our other popular plugin Icegram. The plugin helps you run campaigns by displaying notifications on your website in the form of popups, header bars, and messengers. These notifications come with an email field to capture email addresses which can be integrated with our Email Subscribers plugin.
Using a Shortcode
For Version 4.0 and Higher
For version lower than 4.0
This can be used in any page or post within your website.
[email-subscribers namefield="YES" desc="" group="Public"]
namefield : Set it to YES if you want subscriber to enter their name. Else set it to NO.
desc : A description text that you want to show above subscribe form.
group : The group you want subscriber to go on – default is Public (The mentioned group should be created and should have at least one subscriber in it).
Using PHP snippet
Copy and paste the below mentioned PHP code in your desired template location, i.e., inside the theme PHP file.
<?php es_subbox( $namefield = "YES", $desc = "", $group = "" ); ?>
- $namefield: Set it to YES if you want the visitor to enter their name or else NO
- $desc: A description text that you want to show above subscribe form
- $group: The list you want the visitor to subscribe (make sure the list is already created and it is not empty).
If you want to change the form layout or perform any form related advanced options, use our another free plugin Rainmaker. Please take a look at this article to learn how to use Rainmaker’s form in Email Subscribers.