<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlinkTag Inc &#187; sql</title>
	<atom:link href="http://blinktag.com/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blinktag.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 13:00:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>How to find / replace in mysql for wordpress permalinks that have changed</title>
		<link>http://blinktag.com/how-to-find-replace-in-mysql-for-wordpress-permalinks-that-have-changed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-find-replace-in-mysql-for-wordpress-permalinks-that-have-changed</link>
		<comments>http://blinktag.com/how-to-find-replace-in-mysql-for-wordpress-permalinks-that-have-changed/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 11:06:47 +0000</pubDate>
		<dc:creator>Brendan Nee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blnktag.com/?p=228</guid>
		<description><![CDATA[Recently we’ve helped a few of our clients move wordpress installations between domain names. This is a fairly easy process except that links that were made inside of posts, such as links to other posts, pages and images hosted on the site are likely to break. Also, if you change permalinks around a lot or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="colorbox-228"  src="http://blinktag.com/images/84883d97b43fd4d0ce16abfeb7ca6b51.png" style="float:left;"><br />
Recently we’ve helped a few of our clients move wordpress installations between domain names. This is a fairly easy process except that links that were made inside of posts, such as links to other posts, pages and images hosted on the site are likely to break. Also, if you change permalinks around a lot or move stuff around inside of your wordpress “uploads” folder, you might find lots of broken links.</p>
<p>You’ll need access to run SQL statements on your database. For most people, using phpmyadmin is the easiest way to accomplish this. phpmyadmin is usually available on the control panel backend that your webhost provides.</p>
<p>Before you do anything, its a good idea to backup your entire database. If you are using phpmyadmin, you can do this by selecting your wordpress database and going to “export”. Select “Save as File” and “zipped” or “gzipped”.</p>
<p>Once you are ready to do the find replace, you can enter your SQL statements in the “SQL” tab of phpmyadmin. Here is the syntax for a find replace in mySQL:</p>
<p><code>update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this string', 'replace found string with this string');</code></p>
<p>In wordpress, to search the content of all posts and pages, you would use the table <em>wp_posts</em> and the field <em>post_content</em>:</p>
<p><code>update wp_posts set post_content = replace(post_content, 'find this string', 'replace found string with this string');</code></p>
<p>Its important to note that a forwardslash (/) is an invalid character, so you can use a backslash (\) to escape each forward slash. Its best to use a full URL when find/replacing on the post content as if you just use the slug you might end up changing more than you intended and this is searching the actual text of every post as well as the URLs contained inside of link and image tags.</p>
<p>For example, to change URLs from <a href="http://www.oldsite.com/blog" target="_blank">http://www.oldsite.com/blog</a> to <a href="http://newsite.com/" target="_blank">http://newsite.com</a> would use:</p>
<p><code>update wp_posts set post_content = replace(post_content, 'http:\/\/www.oldsite.com\/blog', 'http:\/\/newsite.com');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blinktag.com/how-to-find-replace-in-mysql-for-wordpress-permalinks-that-have-changed/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 14/22 queries in 0.019 seconds using disk: basic

Served from: blinktag.com @ 2012-02-09 08:15:41 -->
