The Easy Way to Mass Find & Replace WordPress Databases

The Easy Way to Mass Find & Replace WordPress Databases

Web developers who have an experience with changing WordPress url address would know that after migrating the database, URLs inside of it will still refer to the old site. However, WordPress is widely known as a web platform that has a ton of plugins and therefore there are many tools that can assist you to import database easily. But, a tricky method is necessary for requiring the shortcut of changing every URL instance inside the database.

As it is described in the picture below that the old URL in the wp_options table, set as the value of the siteurl and home options, and it’s probably also embedded throughout several other rows and tables in the database. If you find this kind of old URLs may eventually prevent your site from running properly, then you need to change to the new URL, such as below:

yourweb1

In the image above, you will find that the site acme.dev will simply lead to a blank page. Below is given a technique to change all these URLs in the database.

Leveraging WP-CLI

Leveraging WP-CLI is not the only way to change the URLs in the database, you can run an SQL query to replace it, but I find that leveraging WP-CLI is a handier alternative compare to SQL query which is a workable solution, yet at the same time, is not convenient to do. Assuming you have installed WP-CLI and have the wp command accessible as the alias, navigate to the directory where your WordPress site files reside.

Then, run the following command:

wp search-replace ‘http://acme.com’ ‘http://acme.dev

The first parameter, ‘http://acme.com’, is the old entry to be replaced with the second one, ‘http://acme.dev’.

yourweb2

Not only the post_content column and wp_options table but also all the tables within the database will be searched by the command line. Then, it will replace every instance of the entry passed through the parameters of the command, like it is explained by the above screenshot that a total of 225 have been made through a simple line of command.

Moreover, we can use the wp search-replace command, not only for replacing URLs, but also any piece of value stored in the database. The operation can also be limited into a certain table by passing the table name as the fourth parameter, as follows:

wp search-replace ‘.jpg’ ‘.webp’ wp_posts

Bear in mind that taking this action means you have to install the WP-CLI first and it will replace the image extension from .jpg to .webp.

Three Things You Can Do to Get Business from Your Website

Building a website is like preparing a Store. Never expect people will show up by just open the doors. Marketing is needed to tell the world that you’re exists. The way to market a website complete different with physical business. Here are 3 things that you need to carefully pay attention when market website to success :

  1. Build a website that express something. Good interface, design and Top-rated content to offer people. You won’t get any business from a website that it isn’t fully functional, professional biography of your company and what it has to offer. Be more in User-Friendly, attractive and informative content. One of the biggest ways to get business from your website is to make sure that it means business in the first place not just like a photograph diaries of product.
  1. Use anything that offer support freely to your marketing. The best option that helps promote your business is Social Media, with them you don’t have to spent a single dollar to market it. Set up personal account from Facebook, Twitter, Google +, and other social networking profiles for your business to compete with other industry professionals and attract your audience. Utilize things like SEO (search engine optimization) to increase your rankings in search results and improve your visibility. You may even can use such as Blog to tell your specific niche for the intent of showcasing your company as an authority on the subject matter to draw people back to your website that way. Those are absolutely free and improve your business marketing.
  1. Go offline now and then. Many people think it’s enough and logical to market a website by online, they never expect to market their website to the real world. It is important for company have a visibility, however, you have to remember for some people that aren’t even looking yet. By advertising and promoting your business website from real world, you will be able to reach all of the people who might not even think to come to the internet for the things that they need. Plus, you will never have to worry about whether people will ‘find you’ online. You may use some media such as business cards, flyers, word of mouth, and advertising spots to show people exactly where to find you.

 

As you can see, there are a lot of ways to improve your business’s chances of success with a website. You have to explore your options and find the tools that work best for you. No matter what you are looking for, keep these things in mind so that you can get more from your website and success more to your business.