[wp-hackers] absolute URLs in plug-ins and custom types

Bill Erickson bill.erickson at gmail.com
Wed Jul 4 20:51:25 UTC 2012

Yes, you can either hop into phpMyAdmin and do a find/replace, or (and this
is my preference) use a script like searchreplacedb2.php which will go
through the database and do it for you. The benefit to the latter approach
is it will work for serialized arrays as well.

If you have a URL in a text widget, that is stored in a serialized array.
Doing a simple find/replace will cause you to lose the widget content
because the length will change (unless both URLs have exactly the same
number of characters). That script unserializes all of them, does the
find/replace, then re-serializes them.


Bill Erickson
WordPress Consultant

NOTE: To better serve my clients, partners, and most importantly my family,
I've begun checking email only three times per day.

For phone calls, please schedule here: http://tungle.me/billerickson . If
it's an emergency, please call now and leave a voicemail

On Wed, Jul 4, 2012 at 3:18 PM, Erik Martines Sanches <
erik.martinessanches at gmail.com> wrote:

> Bill Erickson skrev 2012-07-04 20:32:
>  And even if you know your environment well and build your specific tool to
>> use relative URLs, WordPress core uses absolute URLs for everything so
>> you'd need to update those anyway (ex: any images inserted into posts).
> So moving from a subdirectory (www.domain.com/test) to the top level (
> www.domain.com), when you say update images inserted into posts, I take
> it this can be done in the phpMyadmin and not have to reupload, right?
> (Hope so!)
> Erik
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>

More information about the wp-hackers mailing list