Title: Removing default button
Last modified: May 26, 2020

---

# Removing default button

 *  Resolved [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [6 years ago](https://wordpress.org/support/topic/removing-default-button/)
 * I’m using this code to remove the default button, but it sometimes causes a “
   headers already sent” error. Is there a better way to accomplish the same task?
 *     ```
       function seamless_donations_cmb2_remove_primary_save_button() {
            ?>
            <style type="text/css" media="screen">
                input#submit-cmb.button.button-primary {display: none;}
            </style>
            <?php
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years ago](https://wordpress.org/support/topic/removing-default-button/#post-12893490)
 * What are you attaching this `seamless_donations_cmb2_remove_primary_save_button()`
   function to? `init` ? Something else? Looks like it’d be most appropriate on 
   the `wp_head` hook as that wouldn’t start till well after when that error type
   should occur.

Viewing 1 replies (of 1 total)

The topic ‘Removing default button’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/removing-default-button/#post-12893490)
 * Status: resolved