Last Updated: February 25, 2016
· penguinpaul

MyBB Custom Pages

A while back I shared how to make custom PHP pages that used MyBB's template: http://coderwall.com/p/71nr0q

Today, I'm here to tell you an even easier method to create and edit these pages.

Create a php file, name it whatever you want it to be named, and put these contents:

    define('IN_MYBB', 1);

    add_breadcrumb("Page Title", $_SERVER['PHP_SELF']); 

    eval("\$page = \"".$templates->get("page_name")."\";"); 


Replace "Page Title" with the title of your page, and replace "pagename" with a unique identifier for your page, such as "aboutus". If you want to prevent guests from seeing the page, find


and replace with

if($mybb->user['uid'] == 0)

Next, head on over to the MyBB Admin Control Panel and go to "Templates & Style". Click "Templates", then "Global Templates". Create a new template and give it the name you gave it above, e.g. "about_us". For its contents, add this:

<title>Your title</title>
Your content here...

Replace the title and content with your page's title and content, then save the new template.

You're ready to go! Just access the page and the content will show up with the MyBB theme the member is using. Whenever you want to edit the page, you can now do so directly from the ACP instead of through the filesystem.

3 Responses
Add your response


Old but gold Paul :D

over 1 year ago ·

just what i needed :D thanks!

over 1 year ago ·

You're the King for this.

over 1 year ago ·