Technology Insights

Update WordPress Amazon Product in a Post Plugin 2.X to Amazon Product in a Post Plugin 3.X

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.

Technology Errors

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.

Technology Insights

MySQL Command To Update Just The Matching Part Of A Column

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.

Technology Insights

How to Update WordPress Blog URL

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.

  1. 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.
  2. Change Blog Address: Under “Settings” and then “General” change the “Blog Address” to the new URL.