You can use following:
update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', '0' );
I hope this helps.
Related Posts:
- How does WordPress decide what template to use as frontpage
- When to use is_home() vs is_front_page()?
- How to store widget fields data as an array?
- How To Add New Option Types To Option Tree?
- Modular theme settings
- get_option function
- How do I show sticky posts on a static front page that also contains content?
- Get category slug and display it on a query_post
- Override Current Theme Setting in wp_config.php
- Why might $input (Settings API) be coming through empty?
- Multiple Custom_Background, is it possible?
- Static Front Page problem
- two tinyMCE editors in the same page
- Set front page as static page [closed]
- Cannot update WordPress General Settings Site Title and Tagline
- How to upload images using Settings API
- Theme settings keep getting reset/erased
- Disable front-page.php template
- Set a static front-page as a landing page programmatically
- Where should I update_options in a theme?
- How can I display/hide certain content based on a Theme Option field?
- Displaying recent post excerpts on static front page
- How can I make my options in an array and store theme in WP options one DB row?
- How to Find the Page the Front Page is Using?
- How to Call pages from a Options Panel
- Efficiency of wp_options vs a new table
- Override plugin option by with a custom theme
- is_home and is_frontpage always true
- Theme Development -> Specific Homepage
- What is the need for the static front page [closed]
- not getting API setting saved confirmation message after update on option page
- What is the best way to build home pages with a lot of sections for distributable themes [closed]
- Confused by the behaviour of “front page” / “home” templates
- Update Specific Key Value in Complex `wp_options` object
- How to remove permalinks links presents in each page of my site?
- static front page ONLY for certain themes?
- Tabbed theme options query about add_settings_section callback function
- is_front_page use in sidebar.php
- 1 post per category on homepage and counting those posts
- Unable to delete option
- 3 x 3 grid of posts on the home page
- Theme Option’s Save Button is not working
- What is the advantage of using home.php over index.php for the front page
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options
- framework for plugin/theme options panel? [closed]
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- Worthwhile to restrict direct access of theme files?
- How Do I Protect My Premium WordPress App Theme from Copying?
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Display Search Result Count
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?
- Minimum Template Files for Theme Development
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- get_template_part vs action hooks in themes
- Theme Activate Hook
- Solutions for generating dynamic javascript / CSS
- wp_redirect() – headers already sent
- Can I create my own “Recent Posts” widget or customize the existing one?
- Custom single template for a specific category
- how can I add an icon/image for a child theme?
- How can I add a URL field to the attachments window?
- The the_post_thumbnail without srcset?
- The proper way to include/require PHP files in WordPress
- Get the first image from post content (eg.: hotlinked images)
- after_setup_theme always runs
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- Getting failure when using filemtime() with wp_enqueue_style
- Do I actually need to link my theme’s style.css in the theme files
- Why is wp_head() creating a top margin at the top of my theme header?
- How do I add version control to my workflow?