How to optimize your SMF forum

Step-by-step tutorial on how to optimize your SMF website for best performance

This tutorial will review the options for optimizing the performance of your SMF forum without installing additional services. If you are looking for better speed of your website, you can review the steps we have described below.


Simple Machines Forum 2.0.x comes with easy to optimize settings. The optimization of your application will improve the loading speed. In this tutorial we will review few of the amazing implemented SMF optimizations.


Step 1 SMF Caching

First of all we should activate the APC caching for your account. In order to perform this we will need to access cPanel. Locate the Software and Services section and click on the Select PHP Version icon. On the following screen we will need to check the apc and click on the Save button in the bottom left part of the page.


Enable APC in cPanel


In order to enable the SMF caching we should be logged as admin of the application. Once the admin area is accessed we should navigate to Configuration -> Server Settings -> Caching. If you have activated the apc module from the cPanel correctly after accessing the Caching page we will be able to see a Caching section. When we scroll to the bottom of the page we should see the following notice:


SMF has detected that your server has APC installed.


After that from the dropdown menu choose Level 1 caching (Recommended) and click on the Save button in the bottom right corner of the page.


Enable Caching in SMF


Step 2 Disable SMF Calendar

We know that the calendar looks fancy but if you do not need this feature for your forum, we recommend to be disabled. The main reason for this recommendation is because on every loaded thread the calendar “looks” for an event. The calendar can be deactivated from Simple Machines Forum admin backend -> Configuration -> Core Features. If the calendar is enabled the on/off button on the right side of the section will be green, press it to make it gray and at the bottom of the page press the Save button.


Disable SMF Calendar


Step 3 Configure Search Method in SMF

If the Search option is enabled for your forum we recommend to be set a search index. This will increase the disk space usage by your application but it will also improve the loading speed of search queries significantly. The search index can be set from the admin backend of your application -> Forum -> Search -> Search method. In the Search index field first create custom index, set it to moderate sized index and then check the Custom index radio button. After all this options are correctly performed press the Save button on the right bottom of the page.


Configure Search Method in SMF


Step 4 Disable Recent Posts on Forum Index

We recommend this feature to be disabled in order to improve the server performance because the recent post feature is a resource consuming process. This feature compiles the list of recent post and as many more posts, members and groups there is the more resource consuming process this will be. Access your admin account of your SMF application -> Configuration -> Current Theme -> Theme Options and Preferences -> Number of recent posts do display on board index field should be set to 0(zero) to disable this feature. After the field is set to 0, click the Save button on the right bottom of the page.



Step 5 Change Avatars Upload Folder

This will decrease the overall load of the server which is generated by your forum. The SMF application recognizes the avatars uploaded in the default folder as an attachments this cause every loading of an avatar image to invoke the index.php file. If we move the images in a separate folder the SMF will handle them as regular images. In order to perform this optimization we will need to access the admin backend -> Forum -> Attachments and Avatars -> Avatar Settings -> Uploadable avatars section. In the Uploadable Avatars section we can see the following fields:


  • Upload avatars to... – from this dropdown menu we should choose the “Specific directory…” option
  • Upload directory – we should put the full path to the new avatar directory. For example:


/home/user/public_html/forum/avatars-new – 


Creating new avatar directory

You can create the new folder for avatars via your cPanel -> File Manager -> New Folder. If you are not familiar with the service, we recommend reviewing our File Manager tutorial.


  • Upload URL – this value should be the URL to the new folder we have just created. For example:


In order to complete this optimization do not forget to press the Save button at the right bottom corner of the page.


Change Avatar Directory in SMF


Existing avatars

If your members have already uploaded avatars they can be moved in the new folder via FTP. We recommend reviewing our FTP tutorial for more details on how to use it.


The last step from this optimization is to update the database. In order to execute a MySQL query we should access cPanel -> phpMyAdmin and select the database that is assigned with the SMF application. After the database is selected we will go to the SQL tab and paste the following MySQL query:


UPDATE `smf_attachments` SET `attachment_type` = '1' WHERE `smf_attachments`.`ID_MEMBER` != 0


Congratulations! You have performed successfully five powerful optimization which will significantly improve the loading speed of your SMF application.