Web development clients seem to love popups. They’re always asking me to add popups to websites. My “go to” solution for WordPress popups is the popular Popup Maker plugin.
But, as explained in this article, WordPress Popup Maker has had its “popup” custom post type set to “private” since version 1.7. While there are cases where that is indeed the right thing to do, it excludes popup content from showing up in your site search results. If you have important content in popups, it’s not good that your content is hidden from site searches or from search engines. It also makes the content more difficult to share.
Fortunately, there is a way to fix this.
In 2015, WordPress introduced a new filter hook to enable you to easily change custom post type settings. By setting the “popup” custom post type to “public” and setting “exclude_from_search” to false, you can make your popup content appear in site search results and appear as regular WordPress pages!
How to Make a Popup Maker Popup Appear as a Regular Page
In your child theme’s functions.php file, add this code:
function enable_popup_maker_pages( $args, $post_type ) { if ( $post_type == "popup" ) { $args['public'] = true; $args['rewrite'] = true; $args['publicly_queryable'] = true; $args['exclude_from_search'] = false; } return $args; } add_filter( 'register_post_type_args', 'enable_popup_maker_pages', 3, 2 );
This makes the “popup” custom post type visible like a regular post to end-users through the URL listed in the Popup Maker editor! And, it will be visible in your site search results. You also now have a real URL that you can share freely!
Hope this helps! – Brian
I am a freelance web developer and consultant based in Santa Monica, CA. I’ve been designing websites using WordPress and from scratch using HTML, CSS, PHP, and JavaScript since 2010. I create websites and web applications for businesses, nonprofits, and other organizations. I have a degree in Electrical Engineering (BSEE) from California Institute of Technology and a degree in Engineering Management (MSEM) from Stanford University.
Discover more from Web Developer Tips and Tricks
Subscribe to get the latest posts sent to your email.
Please Leave a Question or Comment