Title: Breaking post previews
Last modified: August 30, 2016

---

# Breaking post previews

 *  Resolved [fusionplanet](https://wordpress.org/support/users/fusionplanet/)
 * (@fusionplanet)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/breaking-post-previews/)
 * I’m working on a blog were members can add posts via the front-end (not admin).
 * From that page, members can click on a preview button to see their post. This
   clicks to a preview page. Then they have two options: click on a edit or publish
   button.
 * Unfortunately, when I activate the plugin the preview page breaks and no buttons
   are displayed even though no Insert Post Ads content is shown either.
 * I’ve inherited this project from a previous developer. The preview page calls:
 *     ```
       the_content();
   
       //and below it display the buttons
   
       if ( is_user_logged_in() && is_user_post_author($current_user->ID,$post) && !in_array($post->post_status, array('future','publish')) ){
         // display buttons
       }
       ```
   
 * Is there a way to stop/disable IPA from doing anything on this preview page?
 * [https://wordpress.org/plugins/insert-post-ads/](https://wordpress.org/plugins/insert-post-ads/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [fusionplanet](https://wordpress.org/support/users/fusionplanet/)
 * (@fusionplanet)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/breaking-post-previews/#post-6870278)
 * Answering my own question. Please see below for someone who may encounter this
   issue.
 * Create an MU plugin:
 *     ```
       add_filter( 'option_active_plugins', 'disable_ipa_plugin' );
   
       function disable_ipa_plugin($plugins){
       	if(strpos($_SERVER['REQUEST_URI'], '/path-to-page-to-not-run-plugin/') !== FALSE AND strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === FALSE ) {
               $key = array_search( 'insert-post-ads/insert-post-ads.php' , $plugins );
               if ( false !== $key ) {
                   unset( $plugins[$key] );
               }
           }
           return $plugins;
       }
       ```
   
 * credits where credits are due: Modified from [Kamil Grzegorczyk](http://lowgravity.pl/blog/quick-tip-how-to-disable-wp-plugin-on-certain-page/)
   solution.

Viewing 1 replies (of 1 total)

The topic ‘Breaking post previews’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/insert-post-ads_f9f9f9.svg)
 * [Insert Post Ads](https://wordpress.org/plugins/insert-post-ads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-post-ads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-post-ads/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-post-ads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-post-ads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-post-ads/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [fusionplanet](https://wordpress.org/support/users/fusionplanet/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/breaking-post-previews/#post-6870278)
 * Status: resolved