Skip to content


Ridding Yourself of Shadow Topics in phpBB

I’ll eventually write this into a modification, but phpBB moderators and administrators know that, when you move a topic, you’re given the option to create a “shadow topic”, one which will point users to the new topic. What’s not apparent is how to delete these shadow topics or how to have them expire.

It’s actually pretty simple: in phpbb_topics, there’s a field called “topic_moved_id”. When you move a topic and specify that a shadow topic be created, a new topic is added to the database. This topic then owns all the posts associated with the old topic, which becomes the “shadow topic”. The “topic_moved_id” field exists simply to let phpBB know the association between the topic and its shadow.

To remove the fields, all you have to is delete any topic_id that has a non-null topic_moved_id field. Now, the easiest way to do this would be DELETE FROM phpbb_topics WHERE topic_moved_id > 0;, but that deletes all the shadow topics. That’s decidedly not cool; I decided to leave the last 7-ish days of shadow topics.

So, I pulled up my handy-dandy UNIX timestamp converter, fed in 04 17 2005 00 00 00, and got 1113696000 as a timestamp. Working from there, the SQL query gets only marginally harder: DELETE FROM phpbb_topics WHERE topic_moved_id > 0 AND topic_time < 1113696000;. I executed that, and 748 shadow topics were gone from The Rumor Forum.

To turn this into a worthwhile phpBB modification, I just need to mimic how to put this in the Administration Panel in 2.0.x. I've got a couple modifications already installed that I can mimic, but for now, it's worth just posting this go-by for anyone else to use.

Popularity: 32% [?]

Posted in phpBB Modifications.


8 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Siacono says

    I found this little bit of info very helpful and would very much like to see this feature in the admin cp. Thank you very much.

  2. Siacono says

    Actually what would be nice is the see the option in the
    Admin CP > Forum Admin > Pruning

    As a option like

    Remove Shadowed older than mm/dd/yyyy

  3. Geof F. Morris says

    Siacono: I agree, this would be a good option. As I am not administrating phpBB anymore, I can’t help you, but you might take the idea to the phpBB community boards’ Mods Forum and see if anyone is interested in coding it up.

  4. Mohib says

    You can delete that from the Moderator Control Panel :)

  5. Geof F. Morris says

    You might well can now. As noted above, I haven’t administrated phpBB regularly for over a year, and really closer to two. I switched not very long after writing this entry, I believe. :)

  6. Dyrell Hicks says

    Where in the moderator panel is this option to delete shadow topics??

  7. Dyrell Hicks says

    nerver mind, I found it!

  8. Oberdenker says

    Thank you, GF! I was looking for how to delete shadow topics in the php-admin and didn’t find it – until I read your article now. So I managed the extra added topics phpbb_topics (I’m still using phpbb-version 2).



Some HTML is OK

or, reply to this post via trackback.