Title: Programmatically update hide posts checkboxes
Last modified: December 22, 2021

---

# Programmatically update hide posts checkboxes

 *  Resolved [zaheer01](https://wordpress.org/support/users/zaheer01/)
 * (@zaheer01)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/programmatically-update-hide-posts-checkboxes/)
 * Hi,
    I am creating a plugin that needs to integrate with your plugin when my 
   plugin creates the posts using wp_insert_post. Is there a way I programmatically
   update those hide posts checkboxes?
 * My Code is not updating
    update_post_meta(129, ‘whp_hide_on_search’, 0); add_post_meta(
   129, ‘whp_hide_on_search’, 1);

Viewing 1 replies (of 1 total)

 *  Plugin Author [MartinCV](https://wordpress.org/support/users/martin7ba/)
 * (@martin7ba)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/programmatically-update-hide-posts-checkboxes/#post-15195903)
 * Hi Zaheer,
 * The key name starts with _ . As it is below.
    You can check this in plugin source
   code in /classes/admin/WHP_Post_Hide_Metabox.php
 *     ```
       $whp_data['_whp_hide_on_frontpage']     = ! empty( $_POST['whp_hide_on_frontpage'] ) ? true : false;
       $whp_data['_whp_hide_on_categories'] = ! empty( $_POST['whp_hide_on_categories'] ) ? true : false;
       $whp_data['_whp_hide_on_search'] = ! empty($_POST['whp_hide_on_search'] ) ? true : false;
       $whp_data['_whp_hide_on_tags'] = ! empty( $_POST['whp_hide_on_tags'] ) ? true : false;
       $whp_data['_whp_hide_on_authors'] = ! empty( $_POST['whp_hide_on_authors'] ) ? true : false;
       $whp_data['_whp_hide_in_rss_feed'] = ! empty( $_POST['whp_hide_in_rss_feed'] ) ? true : false;
       $whp_data['_whp_hide_on_blog_page'] = ! empty( $_POST['whp_hide_on_blog_page'] ) ? true : false;
       $whp_data['_whp_hide_on_date'] = ! empty( $_POST['whp_hide_on_date'] ) ? true : false;
       $whp_data['_whp_hide_on_post_navigation'] = ! empty( $_POST['whp_hide_on_post_navigation'] ) ? true : false;
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Programmatically update hide posts checkboxes’ is closed to new replies.

 * ![](https://ps.w.org/whp-hide-posts/assets/icon-256x256.png?rev=2674332)
 * [Hide Posts](https://wordpress.org/plugins/whp-hide-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/whp-hide-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/whp-hide-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/whp-hide-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/whp-hide-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/whp-hide-posts/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [MartinCV](https://wordpress.org/support/users/martin7ba/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/programmatically-update-hide-posts-checkboxes/#post-15195903)
 * Status: resolved