Connect with us

Hi, what are you looking for?

WordPress

Tutorial: How to change your WordPress database prefix

How To Change Your WordPress Database Prefix

In this short video, we will be showing you how to change your WordPress database prefix.

There are several ways you can go about making the change and we are going to show two simple methods, the first which involves getting your hands dirty by making changes directly to the database using PHPMyAdmin and the second, which is the quickest out of the two – by using a plugin.

Please make sure that before you attempt to make any changes to your database, whether it be manually or by using a plugin, you backup your database.

As mentioned in the video there has been a lot of debates whether you should be changing your database prefix for security reasons, while most web hosting companies recommend that you change your database prefix to avoid being a potential target to spammers and hackers – who could inject your database with malicious scripts – some security experts believe it is a pointless practice and it doesn’t do anything to improve security.

It’s not an argument I will want to take part in any time soon but it will be something we will talk about in one of our upcoming security for WordPress videos.

Now, without further delay, here is a short video showing you how to change your WordPress database prefix using PHPMyAdmin and a simple plugin. The plugin we have chosen to work within this example is the Brozzme DB Prefix & Tools plugin which is very easy to use. It will allow you to change your WordPress database prefix in a matter of clicks.

As mentioned in the video, the following SQL snippet will update your user’s data tables (inc meta data) so that you, as the admin user, do not lose your administrative rights. Without updating the user’s data tables with the new prefix you will have trouble logging in.

All you have to do is simply replace THENEWPREFIX_ with your new prefix and the CURRENTPREFIX_ with your old prefix, whether it be wp_ or any other prefix an auto-installer may have used.

update THENEWPREFIX_usermeta set meta_key = 'THENEWPREFIX_capabilities' where meta_key = 'CURRENTPREFIX_capabilities';
update THENEWPREFIX_usermeta set meta_key = 'THENEWPREFIX_user_level' where meta_key = 'CURRENTPREFIX_user_level';
update THENEWPREFIX_usermeta set meta_key = 'THENEWPREFIX_autosave_draft_ids' where meta_key = 'CURRENTPREFIX_autosave_draft_ids';
update THENEWPREFIX_options set option_name = 'THENEWPREFIX_user_roles' where option_name = 'CURRENTPREFIX_user_roles';

If you have any questions please feel free to comment below.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisement

More On The Net BLog

Business

As per our previous announcement, the Website Helper blog has now become thenet.blog. Here we have it, 36 approved UK business directories you can...

CSS

CSS media queries are an excellent way to deliver different styles to different devices. Here are CSS Media Queries for targeting your iPad in...

Web Hosting

GoDaddy has become a household brand, they are one of the biggest website hosting and domain name companies in the world. However, being the biggest does...

WordPress

Did you know that uninstalling WordPress plugins from the dashboard is simply not enough? Many website owners have most likely installed and tested several WordPress plugins but...

Business

Are you looking for alternatives to Peopleperhour.com to outsource your next project? For those that don’t know what Peopleperhour.com is, it’s an online freelance micro job...

SEO

Traffic is bad on the road. But it is a blessing on a website or blog- as long as your bandwidth can handle it....

WordPress

The problem faced by many WordPress websites using contact forms is spamming. It is frustrating and time-consuming to deal with. Spamming happens when malicious...

CSS

CSS media queries are an excellent way to deliver different styles to different devices. The rapid growth of mobile devices has made it a...

Advertisement