GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Mass edit url in blog posts on wordpress? (https://gfy.com/showthread.php?t=1018798)

marktruman 04-17-2011 12:14 PM

Mass edit url in blog posts on wordpress?
 
So I have a ton of wordpress blogs, With a shitload of posts. Is there anyway to edit the url in them blog posts? I will be changing it to the same url. I think I heard of a way in phpmyadmin

WarChild 04-17-2011 12:18 PM

You want to change all occurrences of a single URL to a single new URL or you want to change multiple different URLS to be one new one?

TheDoc 04-17-2011 12:18 PM

UPDATE wp_posts SET post_content = replace(post_content, "/replace-this/", "/with-this/");

marktruman 04-17-2011 12:21 PM

Quote:

Originally Posted by WarChild (Post 18064655)
You want to change all occurrences of a single URL to a single new URL or you want to change multiple different URLS to be one new one?


Single URL to a different Single URL

marktruman 04-17-2011 12:23 PM

Quote:

Originally Posted by TheDoc (Post 18064657)
UPDATE wp_posts SET post_content = replace(post_content, "/replace-this/", "/with-this/");

is that a command, where is that entered?

WarChild 04-17-2011 12:25 PM

Quote:

Originally Posted by marktruman (Post 18064668)
is that a command, where is that entered?

That's an SQL statement to update your database that drives yoru blog at the database level. You must have access to your MySQLServer, correct?

alias 04-17-2011 12:27 PM

Quote:

Originally Posted by TheDoc (Post 18064657)
UPDATE wp_posts SET post_content = replace(post_content, "/replace-this/", "/with-this/");

Nice. :thumbsup

TheDoc 04-17-2011 12:29 PM

Quote:

Originally Posted by marktruman (Post 18064668)
is that a command, where is that entered?

If you're unsure what that is, it's best to ask your host to run it for you.... just tell them exactly what you want found and replaced and most hosts will gladly do it for you.

Otherwise, enter php my admin, access the wp db, hit the post table, click the SQL tab at the top, and enter that line.... after you change out what to replace. Your wp_posts table may be named differently.

UPDATE wp_posts SET post_content = replace(post_content, "www.oldurl.com", "newurl.com");

Screwing this up though can really screw some shit up... the last tab at the top, whatever it is, will let you duplicate the post table & structure to a new table name - highly recommended doing this if you've never ran a command like this before.

TheDA 04-17-2011 12:34 PM

There's a way to do it from WP with a plug-in as well.

http://lesterchan.net/portfolio/programming/php/ The DB manager there lets you edit SQL at that level.

It also lets you backup your database before you do it in case you fuck it up :)

TheDoc 04-17-2011 12:34 PM

Quote:

Originally Posted by alias (Post 18064675)
Nice. :thumbsup

Thanks... I just moved a ton of sites to multisite, so the line is fresh on the brain. :thumbsup

If you move to multisite from a standalone wp, you've gota run that to replace the content paths.

Paul&John 04-17-2011 12:41 PM

http://downloads.wordpress.org/plugi...nd-replace.zip


All times are GMT -7. The time now is 09:24 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc