If you use the Amazon Product In A Post Plugin on WordPress you might have either not upgraded yet or decided to not upgrade because the shortcode syntax has changed. You can get around not upgrading by updating the WordPress post content immediately after you upgrade the Amazon Product In A Post Plugin. Below I describe the version that I upgraded and the MySQL syntax used to update the shortcode syntax to display Amazon products in WP posts.
WordPress database error Duplicate entry X for key yarpp_content for query UPDATE wp_posts SET, MySQL Error
Today I was adding a note to a WordPress article I had written a couple of days ago and it appeared to POST without issue after I clicked the Update button in the WordPress admin. I went to the front-end of the site to verify the new content formatted correctly and to my surprise it wasn’t displaying so I figured I must have left a HTML tag or something open since I didn’t get any errors within the WordPress admin when I clicked the Update button for the Post. After further review the content didn’t exist and it appeared that the article had not posted the update at all since there were zero revisions from today. Fixing the problem is easy by using the below information that describes where I located the error, the error itself, and how to resolve it by issuing a single MySQL command.
Earlier I set up a development WordPress site that mirrored a live WordPress installation. To do this I dumped the entire WordPress database using mysqldump and then imported it into a new database with mysql. Among other things that needed to be changed I needed to update any links that referenced the live site’s URL with the development site’s URL. Below I provide the command to make such an update to only a matching portion of a column in row located in a MySQL database.
Below are a couple simple steps to update your WordPress blog’s URL. The below is valid if you are simply switching the URL using the same domain or if you are changing the WordPress domain all together. You will run into problems if you do not make sure to update each item.
- Update WordPress SiteURL: In the database table wp_options make sure to change siteurl to the new URL. This should be the first row in the wp_options table.
- Change Blog Address: Under “Settings” and then “General” change the “Blog Address” to the new URL.