Title: Disable plugin for a certain post_type
Last modified: May 15, 2020

---

# Disable plugin for a certain post_type

 *  Resolved [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/)
 * Hi
    I understand how to disable the plugin for certain pagas or posts. In may
   case, I need to disable for a certain post_type, I don’t know the post id’s, 
   they can be many. Can you give me a hint? Thanks Alain

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/#post-12839195)
 * After some reading and thinking I sorted it out.
    I share this piece of code,
   just in case it is useful to somebody else.
 *     ```
       // Disable WP External Links for certain CPT's
       if ( ! function_exists( 'wpel_init' ) ) { // in case wpel is not enabled
         return;
       } else {
         add_action( 'wpel_apply_settings', 'my_disable_wpel', 10 );
         function my_disable_wpel() {
           $ignored_cpts = array ( 'cpt1', 'cpt2' );
           if ( in_array( get_post_type(), $ignored_cpts ) && is_single() ) {
             return false;
           }
           return true;
         }
       }
       // END Disable WP External Links for certain CPT's
       ```
   
 * Thanks
    -  This reply was modified 6 years ago by [Alain Aubry](https://wordpress.org/support/users/caban13/).
 *  [Manuel Rocha](https://wordpress.org/support/users/manuelrocha88/)
 * (@manuelrocha88)
 * [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/#post-12839365)
 * [@caban13](https://wordpress.org/support/users/caban13/) really sounds a great
   feature. Already put it at our to-do list in order to analysed and probably included
   in the coming updates.
 * If you have a minute, please leave a review. It’s what keeps support going. Thank
   you 🙏 [https://wordpress.org/support/plugin/open-external-links-in-a-new-window/reviews/#new-post](https://wordpress.org/support/plugin/open-external-links-in-a-new-window/reviews/#new-post)
 *  Thread Starter [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/#post-12839642)
 * [@manuelrocha88](https://wordpress.org/support/users/manuelrocha88/) you have
   2 plugins for the same function ?
    this is weird, can you explain why ?
 *  Plugin Author [WebFactory](https://wordpress.org/support/users/webfactory/)
 * (@webfactory)
 * [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/#post-12839992)
 * [@caban13](https://wordpress.org/support/users/caban13/) that was an error in
   pasting 🙂 link should have been for WPEL 😀
 * Why we have 2 – we made one, the other wasn’t maintained so we took over. Preliminary
   efforts to merge failed because people got pissed that we are “forcing them to
   use something else”. So here we are with 2 … not ideal, we know.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Disable plugin for a certain post_type’ is closed to new replies.

 * ![](https://ps.w.org/wp-external-links/assets/icon-256x256.png?rev=2103983)
 * [External Links - nofollow, noopener & new window](https://wordpress.org/plugins/wp-external-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-external-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-external-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-external-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-external-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-external-links/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [WebFactory](https://wordpress.org/support/users/webfactory/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/disable-plugin-for-a-certain-post_type/#post-12839992)
 * Status: resolved