I'm trying to change siteurl and home in the database, but whenever I try to change after 5 seconds they automatically change back to the previous url.
Is it related to the server?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
WordPress has a number of standard methods to change or override these url options:
update_option( 'siteurl', 'https://yourdomain.com' );
update_option( 'home', 'https://yourdomain.com' );
define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );
If your url changes in the address bar, but does not change in the database, this may happen due to WordPress caching. Try one of these: