Why do we want to change this wordpress database table name prefix?
It’s because when you installed WordPress by default, all of your database tables start with wp_.
Hackers know it, so they can potentially do SQL injection, putting junk scripts into your database automatically.
If you are a blogger who wants to secure your database, you are going to change wp table prefix.
So for example, replacing wp_ to lolol_. I know it is a silly prefix but i want to point out that you can only use letters and numbers, but not special characters such as period, coma, etc.
//Do Back up your database first, as it’s a little bit complicated (see my post about backup wordpress database in 2 minutes). The best way is you try it in your local wordpress installation. If you still don’t have it, you can check this post for mac user and this post for windows user.
It’s really a good idea to change the database prefix while you are installing wordpress, so you will have no hassle to change it later on. But if you already have it installed, we can do it manually.
There is also a plugin called wp prefix changer, i have tried it but it didn’t work, so i do change it manually. For some of you who had experience with this plugin and it works, feel free to leave a comment 🙂
Hey there great article.. How long would it take to change the tables on a site that has about 400 articles..
Can you email me please with the answer, thanks for your time
Hey Tony, sure i can email you.
hey its ok.. i did it.. thanks anyway
Awesome Tony! you are very welcome
The video worked perfectly, thank you !
Hello Jack,
You’re very welcome! So glad it works out, Matilda is sooooo pretty 😀 Good luck with new life. If you want to have a picture in your avatar, this video might help you too.
Have fun when family from Aussie comes 🙂 🙂
Ah an avatar, that sounds like a great idea. I’ll give it a go tomorrow. Thank you for the kind words!
And yes we look forward to their arrival 😉
Yes, if you are into blogging community, and want to comment alot in any blogs, it would be much better showing your logo image or any images than default avatar 😀 I agree with you, take the time and you will be fine. Greetings!
Thank you soo much. You are an excellent trainer 🙂
Gratitude
Aspen
Hi, thank you so much for this, it saved me so much time and rescued me from hours of trawling the internet for this information. I have bookmarked your site and will be checking back regularly!
Hello Ben, you’re very welcome.
I am glad the post was useful. Cheers.
Hi Kimi, I found your video to be a great help in fixing a prefix error in a wordpress database I was having trouble with. Thank you for taking the time to make it and share. Best wishes, Kev
Hi Kev!
I am so glad the video could help you, and the most part, you fixed your database prefix error, the database itself is very crucial to our blogs.
Thanks so much for leaving your nice comment,
Have a great week, Kev!
Kimi.
Hi Kimi
Great video.
Never had the confidence to change my database prefix but this video may give me that confidence.
Thanks for a super vid.
Keith!
Did you manage to change all the database prefix? Honestly, I am still afraid if I had to change my database prefix, but I suggest everyone to backup database first, just incase..
I hope your database has any prefix you want by now.
Thanks, Keith!
Kimi.
Excellent tutorial! Thanks a lot for making this available. The only one thing that remains to be mentioned is that you may only use letters, numbers and underscore. I had to do it all over again, because I used a prefix that contained a special character. 😉
Also, it’s definitely not a bad idea to put your site into maintenance mode before to work on the database.
Man, I am really happy it worked so smoothly.
Thanks a lot!
Andreas
Thanks, Kimi. Worked perfectly.
One suggestion. You could just copy the tables to the same db but with the new names using phpmyadmin. Then, no need to backup!
Just a thought.
Paul
Thanks for the tutorial. But will there be any issues, if i download the complete database and open it will a text editor and find and replace all the “wp_” to a new prefix and upload the file again?
Yes, there will always be issues if you do it incorrectly Gowtham.
I suggest you to copy your site with the exact database in your PC or Mac, see this post: https://www.wpvidz.com/copy-live-wordpress-blog-to-computer/
That post I use to copy this blog in my localhost, and then you can try to change your database one by one, and see how it works, if you change all correctly, your blog in localhost will be fine, if not, then something is done incorrect. But at least, your “online” blog will still work, only site in localhost breaks.
I hope this work.
I greatly appreciate your detailed reply. I took a backup of my database and all the files and set it up on my localhost using WAMP, then what i did was i took sql database and replaced all the “wp_” with a new prefix and uploaded in my localhost Database. And it worked. The only thing, was that there was a error showing up in the widget area, so then i placed new widgets and the error disappeared.
I did the same with the live server, and it worked. One thing is that if people want to do it this way, they need to make sure that, they shouldn’t upgrade wordpress in the process.
This helped me a lot. thanks
You’re totally fabulous for creating this video. Gosh I appreciate this so much. Works perfectly.
thank you for this tutorial. it allowed me to migrate our blog to our company server!
Thank you so much for this tut! You helped me with something that was taken me ages. Now my site is safe and I’ve learnt something new. Really REALLY appreciate it Kimi. X