Is there a way to disable the sticky posts feature?

I want to turn this off as I have a custom ordering process using custom fields.

2 Answers
2

You can’t turn it off, because it’s hard-coded into the submit metabox for the post post type, you can however hide the sticky checkbox and update the sticky array to unstick any currently stuck posts.

Hide the sticky checkbox

Add additional CSS to the post and post-new pages

add_action( 'admin_print_styles', 'hide_sticky_option' );
function hide_sticky_option() {
    global $post_type, $pagenow;
    if( 'post.php' != $pagenow && 'post-new.php' != $pagenow )
        return;
    ?>
    <style type="text/css">#sticky-span { display:none!important }</style>
    <?php
}

Unstick any currently stuck posts

Add this one of your theme files, load a page that calls that file, then remove

update_option( 'sticky_posts', array() );

Hope that helps. 🙂

Leave a Comment