Resource icon

XenForo 1 Find Unused Thread Prefixes

With XenForo it is pretty easy to end up going a bit 'thread prefix happy' where you create a lot of thread prefixes in the ACP because they might be used only to realize later that you have way too many prefixes and they aren't all being used. Another scenario may be that you merge a few XenForo forums together and when doing cleaning up the imported you end up with some thread prefixes that may or not be actually getting used.

But how do you do know which ones to get rid off?

The quick answer is a couple of SQL queries. If you're not already familiar with how to issue SQL queries directly on your server than that is question you should ask your host for help with as the instructions can vary greatly based on your hosting type.

After finding the Thread Prefix ID of an unused thread prefix, you can access it directly by going to {your forum URL}/admin.php?resource-categories/prefix.{PrefixID}/edit where {your forum URL} is the URL to your forum and {PrefixID} is the Thread Prefix ID.

Find Thread Prefixes That Are Not Assigned To Any Forums
This query will identify thread prefixes that are defined in the XenForo Admin Panel but are currently not associated to any forums.
Code:
SELECT *
FROM xf_thread_prefix AS tp
WHERE  (SELECT prefix_id
        FROM xf_forum_prefix AS fp
        WHERE fp.prefix_id = tp.prefix_id
        LIMIT 1) IS NULL;

Find Thread Prefixes That Are Not Assigned To Any Threads
This query will identify thread prefixes that are defined in the XenForo Admin Panel but are currently not associated to any threads.
Code:
SELECT *
FROM xf_thread_prefix AS tp
WHERE (SELECT prefix_id 
       FROM xf_thread AS t
       WHERE t.prefix_id = tp.prefix_id
       LIMIT 1) IS NULL
Author
Kevin
Views
2,203
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Kevin

Back
Top