Hide Database Prefix – Method 1

Video Transcript

In this class, we’re going to cover one method of changing the database prefix that’s attached to your WordPress site.

Now it’s a lot easier and safer to change your database prefix and during the installation process, instead of after it’s already installed. But this class is for everybody that was unable to do that. Now, the database being the heart, or at least a very important part of what makes your WordPress site tick, see what I did there is a prime target for hackers to attack. And the default prefix of WP underscore is one of the first things you’re going to look for. Now even if your install process has a default database prefix that is not WP underscore, we kind of touched on that in a previous class. But you want to change the default prefix, you know, just because it’s a default setting. Well, this class is going to get you there. And between this class method one and the next class, method two of changing your database prefix, this one is the easiest method one uses the help of plugins.

And when we’re finished with the plugins, we’re going to deactivate and remove the plugins. Now, there’s actually only one plugin that we’re going to be using to change the database prefix. I am however, going to make things simpler across the board by using two more plugins that will allow us to access our file manager and our database management page. Those two additional locations are so that we can do a backup of two files that are affected by us changing the database prefix. That’s of course, the database itself, which is access through the PHP myadmin. And we’ve got a plug in that covers that that allows us to access that from within a WordPress site instead of having to log in to our control panel.

In most cases, it’s going to be cPanel and the WP dash config dot php file, which is located in your control panels File Manager. Well, there’s a plugin for that as well that allows us to access that file from within our WordPress site. Now all three of these plugins are free. And once we’re done, we’re going to deactivate all three of them and remove all three of them. So let’s first go ahead and log into our admin area. I’ve already done that here. This is the plugin that we’re going to be using to change the database prefix and all three of these plugins, there are alternatives, but these are the ones I’m going to be using. All in one WP security is a powerful plugin and has a lot of bells and whistles to it. And the database prefix change is just one of the options.

My suggestion is that unless you know exactly what you’re doing, do not mess with anything else within this plugin. And once you’re done, deactivate it and remove it file stir is the file management plugin that we’re going to be able to use to access our WP dash config dot php file from within our WordPress site. And WP space. php. myadmin is a plugin that’s going to allow us to access our database from within our WordPress admins and you add these just like you do any other plugin. go to plugins. Click on Add New. Do a search for WP space PHP myadmin install and activate it. Likewise with file stir install an activated and all in one WP security. Same with that install and activate it’s going to go ahead and select all three of these and do a bulk activate because naturally they’re already installed.
First up, we’re going to do the backups. Let’s do the backup of the WP dash config dot php file which is found in our file manager that’s located right up here at the top, just click on File Manager in the flyout give it a minute to load and here we are. This is the file we’re looking for right here WP dash config dot php, right click and then click on download, navigate to the location on your computer where you’re wanting to save this and just leave it alone.

Hopefully you won’t need this. If for some reason, things go wonky and your site just crashes then you’ll need to more than likely log into your control panel because your site won’t be active and then upload and overwrite the existing bad config dot php file with the original one that you downloaded before the problem happened that while we’re here, let’s go and have a look at this file. By right clicking. You can go to Edit file and I’m just going to use code mirror and we scroll on down here just to show you the prefix right here it is now you can see it naturally This is not WP underscore I’ve already changed that but this is where it is reflected at in the WP dash config dot php file. And once we change this through the all in one WP security plugin is going to automatically change here as well. So we won’t have to come back here. The backup of this file is just an in case of you know insurance policy when cancel this out. Now we want to go into our PHP myadmin down here at the bottom and do a backup of our database.

Just like we’ve covered in a previous class more times than not all you’ll have to do is click on Enter PHP myadmin if this does not work, then you’ve got some alternative options here. score and click on the blue button here opens up in a new tab and click on the database name over here to the left. So long as you got the tables displayed here on the right, you’re good. Click on export, the default settings are fine, just click on Go and navigate to the location on your computer where you want to save this to. Again, this is just an in case of if anything does go wrong, then you’ll want to log into your control panel, go into your PHP myadmin. Select your database.

Scrolling down to the bottom, check all the tables and in the drop down here with selected, you want to drop them. Basically we’re going to delete all the tables because we don’t know which one got screwed up. And then come on up here and click on Import, click on browse, navigate to the location on your computer where you downloaded the clean database, upload it and you’re back in business, again, just an insurance policy. That’s how we’re doing a backup. Let’s go ahead and go back into our admin area here. Now then let’s go ahead and change the database prefix. Go to WP security in the flyout click on database prefix right here and it says here it’s a good idea to do a backup we just cover that you can check this box here to have it randomly made for you that being the prefix or typing here, whatever you want, be sure to end it with the underscore Click on Change DB prefix.

And that’s how easy it is now that if you’re getting a white screen of death or any other problems at this point, that’s whenever you log into your control panel, delete your messed up WP dash config dot php file and your database table just like I just showed you, we install the clean ones and you’re back in business. That just means that something happened here in method one that’s not going to work for you. If that’s the case, move on over to method two. But at this point, we’re going to go back into our plugins, we’re going to select these three plugins and deactivate and then delete them. And that’s going to bring us to the end of this class on one method of changing the default database prefix of your WordPress site. Thanks for checking it out and you have a great day.