{"id":9023,"date":"2015-04-08T23:13:00","date_gmt":"2015-04-08T23:13:00","guid":{"rendered":"http:\/\/2slick.com\/web\/?p=9023"},"modified":"2015-04-08T23:17:14","modified_gmt":"2015-04-08T23:17:14","slug":"replace-a-text-on-every-wordpress-page-and-post-using-mysql","status":"publish","type":"post","link":"https:\/\/2slick.com\/web\/replace-a-text-on-every-wordpress-page-and-post-using-mysql\/affordablewebsitestips\/tutorials","title":{"rendered":"Replace a text on every WordPress page and post using MySQL"},"content":{"rendered":"<ol>\n<li>Log into your cPanel.<\/li>\n<li>Click on 'phpMyAdmin' in the 'Databases' section.<\/li>\n<li>Navigate to your database on left hand side of the page.<\/li>\n<li>Click on the table named 'wp_posts'.\n<p>&nbsp;<a href=\"http:\/\/2slick.com\/web\/wp-content\/uploads\/2015\/04\/wp-posts.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9024\" style=\"border: 1px solid black;\" title=\"wp-posts\" src=\"http:\/\/2slick.com\/web\/wp-content\/uploads\/2015\/04\/wp-posts.jpg\" alt=\"\" width=\"323\" height=\"557\" \/><\/a><\/li>\n<li>Click the 'Export' tab at the top of your page and backup the table 'wp_posts', just in case we make a mistake and need to revert.<\/li>\n<li>Click on the 'SQL' tab.<\/li>\n<li>The the 'Edit' link in the top right hand side of the screen.<\/li>\n<li>In the text field (the query field) input <!--DEVFMTCODE--><pre class=\"devcodeblock\" title=\"MySQL\"><table class=\"devcodetools\"><tbody><tr><td>&nbsp;MySQL&nbsp;|&nbsp;<\/td><td style=\"background-image:url('https:\/\/2slick.com\/web\/wp-content\/plugins\/devformatter\/img\/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;\"\/><embed id=\"ZeroClipboard1\" src=\"https:\/\/2slick.com\/web\/wp-content\/plugins\/devformatter\/_zclipboard.swf\" loop=\"false\" menu=\"false\" quality=\"best\" bgcolor=\"#ffffff\" width=\"16px\" height=\"16px\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" flashvars=\"id=1&width=16&height=16\" wmode=\"transparent\" \/><\/td><td>&nbsp;copy&nbsp;code&nbsp;|<\/td><td style=\"cursor:pointer\" title=\"DevFormatter Plugin\" onclick=\"devfmt_credits()\">?<\/td><td width=\"99%\">&nbsp;<\/td><\/tr><\/tbody><\/table><div class=\"devcodeoverflow\"><table class=\"devcodearea\" width=\"100%\"><tr><td class=\"devcodelines\" width=\"1%\">1<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #990099; font-weight: bold;\">update<\/span> wp_posts <span style=\"color: #990099; font-weight: bold;\">set<\/span> post_content <span style=\"color: #CC0099;\">=<\/span> <span style=\"color: #000099;\">replace<\/span><span style=\"color: #FF00FF;\">&#40;<\/span>post_content<span style=\"color: #000033;\">,<\/span><span style=\"color: #008000;\">'rock'<\/span><span style=\"color: #000033;\">,<\/span><span style=\"color: #008000;\">'tree'<\/span><span style=\"color: #FF00FF;\">&#41;<\/span> <\/pre><\/td><\/tr><\/table><\/div><\/pre><!--END_DEVFMTCODE--><strong>Note:<\/strong> This command will replace all the instances of the word 'rock' with the word 'tree' in all your posts and pages throughout your WordPress site. Replace the words 'rock' and 'tree' with the words you want to replace on your site.<\/li>\n<li>Click the 'Go' button to have MySQL process the change.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Log into your cPanel. Click on &#8216;phpMyAdmin&#8217; in the &#8216;Databases&#8217; section. Navigate to your database on left hand side of the page. Click on the table named &#8216;wp_posts&#8217;. &nbsp; Click the &#8216;Export&#8217; tab at the top of your page and backup the table &#8216;wp_posts&#8217;, just in case we make a mistake and need to revert. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8139,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-9023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-wordpress"],"_links":{"self":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/9023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/comments?post=9023"}],"version-history":[{"count":3,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/9023\/revisions"}],"predecessor-version":[{"id":9027,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/9023\/revisions\/9027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/media\/8139"}],"wp:attachment":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/media?parent=9023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/categories?post=9023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/tags?post=9023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}