Make WordPress Core

Opened 12 years ago

Last modified 2 years ago

#18769 new enhancement

Admin should not break if URL changes

Reported by: ambushcommander's profile AmbushCommander Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-patch
Focuses: Cc:

Description (last modified by nacin)

We manage a lot of users who have WordPress blogs, and probably the number one user support request we have to field comes out of this situation:

  1. User decides they want to move their WordPress,
  2. They move the folder to a new URL,
  3. Their admin page stops working, because it still had the old URL hard-coded.

This is silly and should be fixed.

Attachments (1)

18769.diff (5.0 KB) - added by sharifkiberu 7 years ago.
change the get_submit_button() to include the page 'source' of a button so that we can add custom behaviour for specific pages. This will help us check if the site_url has been changed on the 'General Settings Page' thereby providing a warning or guidelines on how to relocate the site!

Download all attachments as: .zip

Change History (10)

#1 @nacin
12 years ago

  • Description modified (diff)

There is a RELOCATE constant that can be set, which will allow wp-login.php to work, and upon login the siteurl setting will be updated.

We can potentially handle this more gracefully, by not requiring the constant and having some sort of migration step/warning. But do we want that? Seems pretty rare/edge to be honest (possibly the first bug report I've seen on this specifically). And then there's the issue with old URLs breaking, so it's not like we'd want to encourage migrations as we won't be able to handle the old URLs.

#2 @AmbushCommander
12 years ago

I don't mind the main site breaking; most users will notice that their CSS has completely broken. What I object to is breaking the admin panel, especially for users who are not comfortable editing source code.

As for why no one has reported this, I suspect people who will be confused by this are also more likely to be people posting in the support forums, not the bug tracker.

#3 @olleicua
12 years ago

  • Cc olleicua@… added

I agree with AmbushCommander here. As someone who has had to consult this page
a few times, I would love for the process to be simpler. The main issue is that there is no way to avoid there being a period where you cannot access the admin.

One serious issue with this is for example if I'm moving my site from http://example.com to http://example2.com, and I misspelled example2 when I changed the site url then I will have to find the record in the db. I recognize it's a corner case but there is always a moment where you have to hold your breath and hope it works. It seems like it should be possible to override the redirect here so that it checks to see if a wordpress installation exists at the new url (for example with a simple file_get_contents call) and use the old url if not.

At any rate I'd love to take this on. Thoughts?

#4 @sorich87
12 years ago

  • Type changed from defect (bug) to enhancement

#5 @SergeyBiryukov
12 years ago

Closed #20818 as a duplicate.

Related: #10970

#6 @kirasong
12 years ago

  • Cc mike.schroder@… added

#7 @freddyware
11 years ago

  • Cc frederick.ding@… added

#8 @chriscct7
9 years ago

  • Keywords needs-patch added

@sharifkiberu
7 years ago

change the get_submit_button() to include the page 'source' of a button so that we can add custom behaviour for specific pages. This will help us check if the site_url has been changed on the 'General Settings Page' thereby providing a warning or guidelines on how to relocate the site!

This ticket was mentioned in Slack in #core by sergey. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.