- Compatible XF 2.x versions
- 2.2
- 2.3
- License
- MIT
- Visible branding
- No
For a site that is no longer accepting new content, you might want to put it into "read only" mode, keeping the content available online for users but preventing users from logging in or posting new content.
You will also want to optimise the site to remove unnecessarily functionality for guests and to improve performance.
There are quite a few configuration changes you can make using the admin UI alone, but there are some elements you will need help to change - which is where this addon comes in (see notes at the bottom of this page for limitations).
I have written a full tutorial on steps to consider when archiving a site, which is intended to followed in conjunction with using this addon: https://xenforo.com/community/resources/how-to-archive-a-xenforo-forum-to-make-it-read-only.7825/
Requires XenForo 2.2.0 or higher. If your forum is still on XenForo 2.1, stay on version 2.0.1 of this addon.
This addon provides the following functionality:
The process to archive users works on all users except the following:
For example, to allow user_id 5 and 293 to retain login access, add the following to your
If you are upgrading from a version before 2.2.0, the old
There is one other setting, for a development or staging copy of an archived forum:
It is deliberately a
XenForo will not let you demote yourself from super admin, so you always keep the ability to log in from your own account. From version 2.2.1, the archive process also refuses to run at all if nothing would be protected, rather than archiving every account including the administrators.
Important: if you have any super admin users who you no longer wish to have login rights to your site, be sure to demote them from super admin status.
Once the addon is installed, review the options to set your message on the home page or at the end of content pages (remove the messages from the options to hide them).
Archiving users
After you have configured your super admins and any other protected users and installed the addon, you should visit the Archive Site functions in the User section of the admin UI.
The List Protected Users screen shows all users who will retain login access:
The List Archived Users screen shows users who have already had their passwords removed:
The List Active Users screen shows users who have not yet been archived:
To archive users, use the Archive Users screen, validate your protected and active users, check the confirmation box and click Archive:
Running
To restore access for a user, use the Restore Users screen in the admin UI, or
UI elements hidden for guests by this addon:
Forum home:
Thread list:
Thread view:
Mobile header:
Member profile:
Thread list:
Media view:
Notes:
Todo list:
You will also want to optimise the site to remove unnecessarily functionality for guests and to improve performance.
There are quite a few configuration changes you can make using the admin UI alone, but there are some elements you will need help to change - which is where this addon comes in (see notes at the bottom of this page for limitations).
I have written a full tutorial on steps to consider when archiving a site, which is intended to followed in conjunction with using this addon: https://xenforo.com/community/resources/how-to-archive-a-xenforo-forum-to-make-it-read-only.7825/
Requires XenForo 2.2.0 or higher. If your forum is still on XenForo 2.1, stay on version 2.0.1 of this addon.
This addon provides the following functionality:
- a UI and CLI tool to remove passwords from users to prevent them logging in and to minimise the risk of credential leakage if your site ever gets hacked (selected users can retain login rights for maintenance and testing purposes)
- prevents emails being sent to any user who is not a super admin and not protected - whether or not they have been archived - and records each attempt in the server error log, because on an archived site an attempt to email a member is worth looking into
- provides a meaningful message to users if they try to log in, informing them that the site has been archived
- prevents archived users from resetting their passwords using the forgot password link
- show a message to users below the title on the home page
- replace the "you must log in to post" message below content on thread pages and forum pages with a custom message and optionally a link (eg to a new site)
- hides UI elements from guests:
- New posts button on forum home page
- What's new icon in the page header (the What's New navigation tab and the entries in its menu are separate, and are removed through Admin CP > Appearance > Navigation - see the tutorial)
- Followers list on member profile pages
- Following list on member profile pages
- Birthday on member profile pages
- Lock symbol on locked threads in thread list
- "Not open for further replies" notice on closed threads
- Link to latest member from forum statistics widget
- Gallery BB Code link on media pages
- Members online widget
- command line tools:
archive:archive-all-users,archive:restore-all-users,archive:archive-userandarchive:restore-user, plusarchive:configto print the settings in use and where each one came from, andarchive:validateto check that the forum can do what it is set up to do - including whether any accounts can still log in, and whether every template modification still matches the template it targets
The process to archive users works on all users except the following:
- super admins
- any other user_id listed in the
$config['archiveSite']['protectedUsers']setting
config.php file:
PHP:
// all superadmins are automatically protected
// add the user_id of any additional users who will be permitted to log in to the archived site
$config['archiveSite'] = [
'protectedUsers' => [],
];
For example, to allow user_id 5 and 293 to retain login access, add the following to your
config.php file:
PHP:
$config['archiveSite'] = [
'protectedUsers' => [5, 293],
];
If you are upgrading from a version before 2.2.0, the old
$config['archiveSiteProtectedUsers'] setting still works and needs no change. Where both are set, the newer one is used.There is one other setting, for a development or staging copy of an archived forum:
PHP:
$config['archiveSite'] = [
'protectedUsers' => [5, 293],
'allowMail' => true, // let XenForo email members as it normally would
];
It is deliberately a
config.php setting rather than an option, so that email to every member of an archived forum cannot be switched back on from the control panel by accident.XenForo will not let you demote yourself from super admin, so you always keep the ability to log in from your own account. From version 2.2.1, the archive process also refuses to run at all if nothing would be protected, rather than archiving every account including the administrators.
Important: if you have any super admin users who you no longer wish to have login rights to your site, be sure to demote them from super admin status.
Once the addon is installed, review the options to set your message on the home page or at the end of content pages (remove the messages from the options to hide them).
Archiving users
After you have configured your super admins and any other protected users and installed the addon, you should visit the Archive Site functions in the User section of the admin UI.
The List Protected Users screen shows all users who will retain login access:
The List Archived Users screen shows users who have already had their passwords removed:
The List Active Users screen shows users who have not yet been archived:
To archive users, use the Archive Users screen, validate your protected and active users, check the confirmation box and click Archive:
Running
php cmd.php archive:validate afterwards will tell you whether the run finished - it reports any accounts that are neither archived nor protected, so a run that stopped part way, or accounts that have registered since, do not go unnoticed.To restore access for a user, use the Restore Users screen in the admin UI, or
archive:restore-user and archive:restore-all-users from the command line. A restored user is given a new random password, so they will need to use the forgot password link to set one they know - the original password is removed when the account is archived and cannot be recovered. An account that never had a password in the first place, such as one registered through a connected account, is left without one.UI elements hidden for guests by this addon:
Forum home:
Thread list:
Thread view:
Mobile header:
Member profile:
Thread list:
Media view:
Notes:
- other UI elements can be hidden using admin settings - follow the tutorial for full instructions
- template modifications are designed to work with the default theme and UI elements might not be hidden correctly on customised themes - some additional work might be required
- email to members is blocked for every member who is not a super admin or protected, not only for those who have been archived, so take care installing this addon on a site that is still in use
- I have not yet implemented any changes for XF Resource Manager - that is on my todo list.
Todo list:
- look at UI elements for Resource Manager and hide any which don't make sense for guests
- consider an option to automate the bulk removal of user conversations
- consider a tool to remove deleted posts made by deleted users (you can't search for the posts because they are "guest" posts, nobody can see them because they are deleted, and it won't affect the overall post count)
- consider a tool to make bulk changes to user date of birth (personal information) and other profile fields such as location
- Related resources