Option to set static front page disappeared from admin reading settings

Happily coding along all of a sudden I realise my homepage is now showing blog posts and the setting to set a static home page is missing from the reading option (see screen shot).

In the database the option show_on_front was now magically set to posts as well.

Some people have said that it is because there are no pages or no public pages. However, I have pages which are also public.

I have done the following for the moment

function force_static_page(){
    update_option( 'show_on_front', 'page', true);
    update_option( 'page_on_front', 28, true);
}
add_action('init', __NAMESPACE__ . '\\force_static_page');

enter image description here

4 s
4

I just had the same problem but fixed it quickly! 🙂

In my case, my homepage was on draft. Apparently, the settings then can’t find the homepage anymore. It thinks it’s gone and disables the option to set a default homepage.

So turn on your homepage to visible. (also name it “Home”) Hope it works for you!

Cheers, Koen

Leave a Comment