Title: Duplicate functionnality limited by post_type
Last modified: August 30, 2016

---

# Duplicate functionnality limited by post_type

 *  Resolved [Chriris](https://wordpress.org/support/users/chriris/)
 * (@chriris)
 * [11 years ago](https://wordpress.org/support/topic/duplicate-functionnality-limited-by-post_type/)
 * Thanks for your plugin, it’s great !
 * Do you know if it’s possible to exclude duplicate functionnality for specfic 
   post_type?
 * If yes, it exists a hook to add in functions file.
 * For next release, should be possible to add checkbox options post_type inside
   back-office?
    /wp-admin/tools.php?page=mtphr_post_duplicator_settings_menu
 * [https://wordpress.org/plugins/post-duplicator/](https://wordpress.org/plugins/post-duplicator/)

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

 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [11 years ago](https://wordpress.org/support/topic/duplicate-functionnality-limited-by-post_type/#post-6216337)
 * You should be able to add this to your functions.php file:
 *     ```
       function my_custom_action_row( $actions, $post ){
   
       	// Get the post type object
       	$post_type = get_post_type_object( $post->post_type );
   
       	if( $post_type == 'my_post_type' && isset($actions['duplicate_post']) ) {
       		unset( $actions['duplicate_post'] );
       	}
       	return $actions;
       }
       add_filter( 'post_row_actions', 'my_custom_action_row', 20, 2 );
       add_filter( 'page_row_actions', 'my_custom_action_row', 20, 2 );
       ```
   
 *  Thread Starter [Chriris](https://wordpress.org/support/users/chriris/)
 * (@chriris)
 * [11 years ago](https://wordpress.org/support/topic/duplicate-functionnality-limited-by-post_type/#post-6216355)
 * Thanks for all! it works properly ^^
 * I change a little thing using an array to list easily several post_type.
 *     ```
       $hide_for_posttype = array('post_type_A','post_type_B','post_type_C');
       	if( (in_array($post->post_type, $hide_for_posttype)) && isset($actions['duplicate_post']) ) {
       		unset( $actions['duplicate_post'] );
       	}
       ```
   
 *  Plugin Author [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * (@metaphorcreations)
 * [11 years ago](https://wordpress.org/support/topic/duplicate-functionnality-limited-by-post_type/#post-6216360)
 * You’re welcome! Glad it’s workout out.

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

The topic ‘Duplicate functionnality limited by post_type’ is closed to new replies.

 * ![](https://ps.w.org/post-duplicator/assets/icon-128x128.png?rev=3419621)
 * [Post Duplicator](https://wordpress.org/plugins/post-duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/post-duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-duplicator/reviews/)

## Tags

 * [post-type](https://wordpress.org/support/topic-tag/post-type/)

 * 3 replies
 * 2 participants
 * Last reply from: [metaphorcreations](https://wordpress.org/support/users/metaphorcreations/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/duplicate-functionnality-limited-by-post_type/#post-6216360)
 * Status: resolved