WooCommerce: Sticky Product “Update” Button @ WP Admin

In the WooCommerce product edit / add new product screen, the “Publish” / “Update” button is crucial for saving changes.

However, when editing long product descriptions, adding images, or configuring variations, the button can disappear as you scroll down. This forces users to scroll back up every time they need to save, which can be frustrating and time-consuming.

A simple solution is to make the button sticky, ensuring it remains visible no matter how far you scroll. With a small CSS snippet, you can fix the button’s position in the middle of the screen, improving workflow efficiency and reducing unnecessary clicks.

In this post, I’ll share a quick code snippet that achieves this with minimal effort. Whether you’re managing a large WooCommerce store or simply looking for a more convenient editing experience, this tweak can make a big difference. Let’s dive into the code and make your “Publish” / “Update” button always accessible!

PHP/CSS Snippet: Make the Product Update Button Sticky @ Edit Product Page

/**
 * @snippet       Sticky update product button @ WP admin
 * @how-to        businessbloomer.com/woocommerce-customization
 * @author        Rodolfo Melogli, Business Bloomer
 * @compatible    WooCommerce 9
 * @community     https://businessbloomer.com/club/
 */

add_action( 'admin_head', 'bbloomer_admin_inline_css' );

function bbloomer_admin_inline_css() {
    global $post;
    if ( $post && get_post_type( $post ) === 'product' ) {
        echo '<style>#publish { position: fixed; top: 50%; right: 10px; z-index: 1000; box-shadow: 0px 2px 5px black; width: 150px; }</style>';
    }
}

Note: this also works for the “Publish” button @ add new product page:

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

2 thoughts on “WooCommerce: Sticky Product “Update” Button @ WP Admin

  1. Awesome thanks Rodolfo so much this is really usefull. I have updated this for other custom post types as follows and slightly changed the position:

    add_action( 'admin_head', 'bbloomer_admin_inline_css' );
     
    function bbloomer_admin_inline_css() {
        global $post;
        if ( $post && get_post_type( $post ) === 'events' || $post && get_post_type( $post ) === 'careers' || $post && get_post_type( $post ) === 'members' || $post && get_post_type( $post ) === 'product' ) {
            echo '<style>#publish { position: fixed; top: 7%; right: 40px; z-index: 1000; box-shadow: 0px 2px 5px black; width: 150px; }</style>';
        }
    }
    
Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *