How to Make a WordPress Popup Maker Content Appear in Search Results

My web development clients seem to love popups. They’re always asking me to add popups to websites.

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 search. 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



Leave a Comment or Ask a Question

This site uses Akismet to reduce spam. Learn how your comment data is processed.