Title: Disable sticky posts function
Last modified: August 18, 2022

---

# Disable sticky posts function

 *  [Safety13](https://wordpress.org/support/users/safety13/)
 * (@safety13)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/)
 * Is it possible to disable the sticky posts function and/or hide it from appearing
   on the admin pages? My theme does not support the feature but the volunteer editors
   keep trying to use it for all their posts.
 * This code removes it from the Quick Edit page, but not the main Add New Post 
   page in the right hand column.
 *     ```
       // Hide sticky posts
       add_action( 'admin_print_styles', 'hide_sticky_option' );
       function hide_sticky_option() {
       global $post_type, $pagenow;
       if( 'post.php' != $pagenow && 'post-new.php' != $pagenow && 'edit.php' != $pagenow )
           return;
       ?>
       <style type="text/css">#sticky-span { display:none!important }
       .quick-edit-row .inline-edit-col-right div.inline-edit-col > :last-child > label.alignleft:last-child{ display:none!important; }</style>
       <?php
       }
       ```
   

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

 *  [Kamal Prasad Sah](https://wordpress.org/support/users/kingshah823/)
 * (@kingshah823)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15929175)
 *     ```
       function k_exclude_sticky( $wp_query ) {  
           set_query_var( 'ignore_sticky_posts', 1 );
       }
       add_action( 'pre_get_posts', 'k_exclude_sticky' );
       ```
   
 * // add above line of code on your function.php file
    -  This reply was modified 3 years, 9 months ago by [Kamal Prasad Sah](https://wordpress.org/support/users/kingshah823/).
 *  [Kaavya Iyer](https://wordpress.org/support/users/kaavyaiyer/)
 * (@kaavyaiyer)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15929276)
 * Hi [@safety13](https://wordpress.org/support/users/safety13/),
 * Try this:
 *     ```
       add_action( 'admin_print_styles', 'hide_sticky_option' );
       function hide_sticky_option() {
       global $post_type, $pagenow;
       if( 'post.php' != $pagenow && 'post-new.php' != $pagenow && 'edit.php' != $pagenow )
           return;
       ?>
       <style type="text/css">
        body.wp-admin.post-type-post .interface-interface-skeleton__sidebar .components-panel__body.edit-post-post-status .edit-post-post-schedule + .components-panel__row {
           display: none;
        }
       .quick-edit-row .inline-edit-col-right div.inline-edit-col > :last-child > label.alignleft:last-child { 
           display: none !important;
        }
       </style>
       <?php
       }
       ```
   
 * I hope this helps! Let me know if this works!
 *  Thread Starter [Safety13](https://wordpress.org/support/users/safety13/)
 * (@safety13)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15929369)
 * Thanks Kamal and Kaavya but neither solution works.
 *  [Kaavya Iyer](https://wordpress.org/support/users/kaavyaiyer/)
 * (@kaavyaiyer)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15929402)
 * Which theme are you using? Please try switching to one of the default core themes
   like Twenty Twenty-One, add the above code and let me know if that works.
 *  Thread Starter [Safety13](https://wordpress.org/support/users/safety13/)
 * (@safety13)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15929467)
 * Kaavya,
 * Using the most recent version of the Vantage theme.
 * You are correct… your solution works perfectly with the Twenty Twenty Two theme.
 * Thanks!
 *  Thread Starter [Safety13](https://wordpress.org/support/users/safety13/)
 * (@safety13)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15932772)
 * Is this a viable option to Kaavya’s solution or am I missing something?
 *     ```
       add_action( 'admin_print_styles', 'hide_sticky_option' );
       function hide_sticky_option() {
       global $post_type, $pagenow;
       if( 'post.php' != $pagenow && 'post-new.php' != $pagenow && 'edit.php' != $pagenow )
           return;
       ?>
       <style type="text/css">
        .components-panel .components-panel__body:first-child .components-panel__row:nth-child(5){
          display: none !important; 
        }
   
       .quick-edit-row .inline-edit-col-right div.inline-edit-col > :last-child > label.alignleft:last-child { 
           display: none !important;
        }
       </style>
       <?php
       }
       ```
   

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

The topic ‘Disable sticky posts function’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 6 replies
 * 3 participants
 * Last reply from: [Safety13](https://wordpress.org/support/users/safety13/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/disable-sticky-posts-function/#post-15932772)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
