Custom Fields
Support MB Settings Page Disabling submit button in option page

  • Creator
  • #10900
    Resolved Bezzo


    Is there any possibility to disable submit option page? I want to create sub-option page in which there are only some information displayed from database and that submit button might be confusing 🙂


Viewing 1 replies (of 1 total)
  • Author
  • #10923
    Anh Tran

    Hi Bezzo,

    You can easily hide the submit button with CSS.

    This code below lets you enqueue a CSS file for the settings page:

    add_action( 'admin_enqueue_scripts', function() {
        $screen = get_current_screen();
        if ( 'your-screen-id' == $screen->id ) {
            wp_enqueue_style( 'your-file', 'http://url-to-your.css' );
    } );

    To get the screen ID of the settings page, you can use the Inspector plugin. The screen ID is shown in the "Help" tab, like this:

    View post on

    In your CSS file, you can simply enter this:

    .wrap .submit { display: none; }

    If the process above is complicated, you can use a "quick and dirty" tip below:

    When you register a meta box for the settings page, add a custom_html field like this:

    $meta_boxes[] = [
        // Other fields
            'type' => 'custom_html',
            'std' => '<style>.wrap .submit { display: none; }</style>',

    It will output the <style> to the page and hide the submit button.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.