Hide Database Prefix – Method 2
Video Transcript
In this class, we’re going to tackle method two of changing our database prefix after we’ve installed WordPress.
Now the only reason you should be using method two is because you already tried method one, and it failed. So with that in mind, if you have not done so yet, make sure that you’ve replaced the messed up WP dash config dot php file and your database with the originals that you backed up in the previous class on method one, that way we’re working with a functioning WordPress site like what we have here, I’m already logged in as administrator. And just to show that it’s working, there we go. Let’s come back to our home page. Now on the prior class, we were able to access our database and our config dot php file from within our WordPress admin area, we can’t do that this time around with method two. So that means we have to log in to our control panel.
And in my case, it’s c panel, because here we need to access our config dot php file with our file manager, and our database within our database manager. And that’s PHP myadmin. In my case, now, there’s basically three steps, maybe four ish or so most of which are going to take place in PHP myadmin. So let’s go ahead and begin there. And if you have multiple databases, select the one assigned to the site you’re working on. And in my case, I only have the one. So click on that. So that way here in the right panel, we have all the tables. So the first step, and by the way, there’s actually a few different ways you can do this. So if you come across a different method in changing the prefix, that’s fine, so long as it works. Otherwise, follow these steps to the letter and met, the two will work perfectly for you no matter what the case.
So first off, let’s go ahead and either click on Check all or enter a checkmark in that box setup. In either case, it’s selecting all the tables. And with all the tables selected, in this box here, the says was selected, click on that, and then click on replace table prefix, you’ll get this pop up saying from and to in the from box, you want to type in the existing database prefix, you want to change in the toolbox, you want to type in the prefix, you want to change that to and then click on Continue. And you think at this point, we’re done. Now it would be nice, but now we’re not. Because there’s some stragglers stuck in amongst here. And here’s for what’s called queries will come in handy. You want to make sure that we’re in the database here, click on SQL.
And I’m going to include a copy and paste document along with this class. So that way you do not have to Google What the heck do I put in that query. This is the first one, I’m going to copy that to my clipboard. Get this out of the way, paste that in here. And in both cases, step two and step three, which I’ll cover in a second, you want to replace the word new and old, leaving everything else intact, and then replace those with your new database prefix and old database prefix. And again, you want to make sure you’ve got the underscore at the end, and everything else still intact, the percentage signs, the single quotations and all that stuff. And with that, click on Go. Okay, we got one that took place there, I’m going to show you how we can take care of the stragglers here in a second.
Come on back to SQL power. Before we do that, you want to make sure you’re in the database, not this table. So click right here that we’ve got all the tables shown up here. Go back into SQL, let’s go into Step three, or the second SQL query. And that’s these three lines right here. Again, we’re replacing the words new and old, with our new database prefix and old database prefix, Copy that, paste in here make the change. And you might even find it easier to make those changes on the copy and paste document. Instead of trying to mess with a smaller print in here. Whatever is easiest for you.
Take another quick look, make sure you got the underscore everything else is still intact. And click on Go. No red boxing errors errors were in good shape. So this time around, we got five rows, click our database up here to make sure we’ve got all the tables displayed. And always go into search, type in the old prefix, which is still listed right here and will be until we refresh the entire page. So don’t worry about that. Then you can leave the default setting here, down here, inside tables, click on Select all that we were selecting all the tables, we’re searching for the old database prefix any stragglers that might be left around. That’s what’s going to show up. So ideally, we want to have zeros across the board here, but we’ve got a three match right here under options. Click on Browse.
And all we’re looking for is something that says the old prefix name these two here we’re not worried About frankly, those are because of a plugin that I’ve got installed. But this is the little one we need to change click on Edit is what we need to change right here. Just select the prefix name, change the old to the new. That’s all we’re doing. We don’t have to mess with anything else, then click on Go to make that change. Lastly, we need to make that same change in our config dot php file which is in our file manager. and higher we need to get to the your WordPress root directory. do so in my case, it’s public underscore HTML and in your root directory of your WordPress installation, locate your WP dash config dot php file, either selected and then click on Edit up here or right click on the file and click on edit in the pop up. In other cases, what we’re looking for, scroll on down until you find the table prefix.
And more than likely, it has not automatically changed. It’ll do that with method one, but not in method two. And here just selected type over changing it to your new database prefix. Click on Save. And we’re good. Let’s go on back to our site refresh. It might require you to log in or it might not poke around, make sure everything’s still working just fine. And we’re in good shape. Fantastic. And that’s going to bring us to the end of this class on method two of changing the database prefix after the WordPress installation. Thanks for checking it out and you have a great day.