Need popups to grab your users’ attention? Marketing call-to-actions that open on scroll, timer, click, matched referer or even hover?
Multiple popups on one page? This plugin has it all. It provides styling consistent with core block editor blocks plus additional features.
β Unlike some other plugins, Makeiteasy Popup integrates seamlessly with WordPress,
feeling like a native, built-in WP block. Itβs lightweight and self-sufficient,
without the heavy burden of a large blocks library.
It relies on a single tiny dependency – micromodal.js – with a combined total of only 10 kB of JavaScript β
π Try demo – there is a “Live preview” button on the top of this page π
Currently, opening several modal popups simultaneously is impossible due to the limitations of the Micromodal.js library.
Future versions will replace this library with the native Dialog
HTML element, including automatic migration for existing popups.
The block sidebar provides many options, most of which function similarly to other blocks. Notable options include:
– Opening time selector: See the detailed section below.
– Layout type: Floating, Fixed, Attached
– Popup Enabled: Temporarily hide the popup without deleting it.
– Open on interval: Open on given interval in days.
– Open on matching referer: Open if the user’s referral URL matches.
https://github.com/Lovor01/makeiteasy-popup
Using Javascript:
import { ReactComponent as CloseIcon } from '../assets/close-x.svg';
addFilter( 'makeiteasy-closeButtonIcon', 'makeiteasy/makeiteasy-popup/close-icon', () => (<CloseIcon />) );
If you customize button this way and you already have posts(or pages) with popup block,
on post reopening the message “This block contains unexpected or invalid content.” will be presented.
In such case choose “Attempt to repair block” and if it looks good, save post.
Using PHP:
add_action( 'render_block_makeiteasy/popup', function($content) {
$svg = file_get_contents( __DIR__ . '/path_to_file/close-button-dark.svg' );
return preg_replace(
'~(<button.*class="makeiteasy-popup-close".*?>).*(</button>)~m',
"$1$svg$2",
$content
);
} );
Custom events ‘makeiteasy/openModal’ and ‘makeiteasy/closeModal’ are fired on modal open and close.