Hard coding site URL bad?
-
Howdy all,
Couldn’t find an answer to a question I have via search (usually can!) so I’m breaking down, ending my time as a lurker and making my first post…
I’ve got a client who has access to the general settings page of his blog (his admin dashboard is pretty well stripped down otherwise) as he wants to change up his tagline frequently, but he’s already accidentally changed the site url on one occasion. My question is regarding the code added to functions.php to get things back on track…
update_option('siteurl','http://example.com/blog'); update_option('home','http://example.com/blog');
The documentation says to remove the code once up and running again, but I kinda liked how when that code is in place the URL fields on the general settings page are locked.
Having to edit functions.php for any future site root moves doesn’t seem like a big deal to me… Any reason not to just keep the code in functions.php to keep those particular fields on the general settings page non-editable?
Thanks for any insight!
- The topic ‘Hard coding site URL bad?’ is closed to new replies.