Add a table prefix to XenForo

Lu Jia

Active member
Hi all,
I want to know if someone knows which file/files should I edit if i want to add a prefix to all xenforo's table.
Thanks in advance :)

Chris D

XenForo developer
Staff member
This isn't possible, unfortunately.

The XenForo developers decided for a number of reasons that the XenForo database table prefix would be hard coded as xf_.

This is why it's not possible to specify your own prefix, and also why it is infeasible to edit any files to make it happen: It isn't a variable so you would probably need to edit nearly three thousand files to hard code it back to anything else. This is definitely not recommended! Nor would it be supported by any add-on.

Why do you need this ability to change the prefix?


Well-known member
You could inject your own database object. You would need to know what you are doing though.