Skip to content
Advertisement

How to hide specific elements in General Settings

There’s any way to hide these elements? I only want to keep “Site Title” and “Tagline” two fields in General Settings page. like that

Advertisement

Answer

There is no filter to hide disable the fields, you can hide the fields using css but they are still there. you can add this to your themes function.php

add_action('admin_head', 'css_general_options');

function css_general_options() {
  echo '<style>
    /* Hide all Fields on the General Options page */
    .options-general-php .form-table tr {
        display:none;
    }
    /* Display the 1st and 2nd row on the General Options page */
    .options-general-php .form-table tr:nth-of-type(1),
    .options-general-php .form-table tr:nth-of-type(2){
        display:table-row;
    }</style>';
}
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement