Why a custom Moodle theme needs work for Bootstrap 5
A custom theme built on Boost-era Bootstrap will need deliberate rework before a Moodle upgrade that moves the front end to Bootstrap 5. The Bootstrap 4 to 5 change renames and removes CSS classes, utility classes, data attributes and JavaScript APIs that many custom themes and plugins depend on, so pages that looked correct on the old version can lose layout, menus, modals or form behaviour after the upgrade. It matters because these breaks are often silent: the site still loads, but parts of the interface are wrong for students, teachers and administrators.
Teams usually need this work in three situations. The first is upgrade planning, when the target Moodle release is chosen and someone must estimate how much of the theme and plugin set is affected. The second is a theme rebuild, when a branded child theme has accumulated overrides to core templates, custom SCSS and page-level styling that will not survive the new markup. The third is a plugin audit, when local, block or activity plugins contain their own Bootstrap 4 markup or JavaScript that must be checked against the new framework. Confirm the target release and its server requirements in the official release notes before scoping, because the minimum starting version and the supported PHP and database versions differ from one release to the next.
The update covers the theme's SCSS variables and any custom stylesheets, template overrides and renderers, JavaScript that calls Bootstrap components, and the plugins that inject their own classes into core pages. It ends with a test plan run against a copy of production, not a faster path straight to live. Ask any partner to show the inventory of overridden files and plugins, the list of pages it will test, and the sign-off criteria, since those three items determine how much of the work is predictable before development starts.
Where custom themes and plugins usually break
Most upgrade failures in custom Moodle themes and plugins come from a small set of places where code depends on core markup, classes, or scripts that changed. Each card below names one area, the symptom it produces, and how to find it before production users do.
Utility and class names in templates
Bootstrap 5 renames and removes utility classes that Bootstrap 4 code relied on, such as the margin, padding, float and text alignment helpers, and some component classes moved or changed. Your theme templates and plugin output may still use the old names, so spacing and alignment shift without any PHP error. Search your theme and plugin templates for every class in use, then compare that list against the Bootstrap 5 class reference before upgrading. Visual regression screenshots of key pages will catch what a search misses.
JavaScript components used by plugins
Bootstrap 5 replaces the jQuery plugins used for modals, dropdowns, tooltips and popovers with its own vanilla JavaScript API. Custom themes and plugins that call the old jQuery methods or rely on data attributes will stop opening dialogs or menus, and the failure often appears only in the browser console. Check every custom script for jQuery calls to Bootstrap components, and test each interactive control, including those inside plugin pages and modal forms.
SCSS variables and custom mixins
Custom presets and SCSS that set or read Bootstrap variables can fail when variables are renamed, removed or changed in default value. A mixin that wraps a Bootstrap mixin may stop compiling, and a compile error can block the whole theme, not just one page. Compile the theme against the target Moodle version in a staging build, and review each variable your SCSS references against the Bootstrap 5 variable list.
Template overrides copying older core markup
A template override copied from an older core Mustache file keeps the old markup, so it can omit new wrapper elements, ARIA attributes or classes that the updated core expects. The page may render without errors but lose layout or accessibility behaviour that core now provides. Compare each overridden template with its current core version, record the differences, and decide whether to merge them or remove the override and rely on core output.
Third-party plugin CSS and JavaScript
Plugins from the directory often ship their own stylesheets and scripts written for Bootstrap 4 or for a specific Moodle release, and they may load a second copy of Bootstrap or jQuery. The result is conflicting styles, duplicated event handlers or a plugin page that looks correct while its dropdowns stop working. Confirm each plugin lists support for your target version, then test its pages with your theme applied, not only with the default theme.
Icon and font assets
Themes that reference icon fonts, custom SVG sets or font-based icon classes can lose icons when the icon mapping or font files change between releases. Missing icons often show as empty boxes or blank spaces, and they appear in navigation, course listings and activity headers. Inventory every icon reference in your theme and plugins, confirm each one resolves on the target release, and check that the font or SVG files are still served from the paths your web server exposes.
Update approaches and when each fits
This table compares four ways to bring a custom Moodle theme forward to the Bootstrap 5 base in Moodle 5.0 and later. Read each row for the situation it suits, the work that dominates its cost, and the upgrade risk you carry into the next core release. The main takeaway is that the amount of custom SCSS and template change you keep is the single biggest lever on both cost and risk.
| Approach | When it fits | Main cost driver | Upgrade risk |
|---|---|---|---|
| Rebase a Boost child theme onto the new core with minimal overrides | The theme mostly sets colours, logos and settings, with few template or SCSS changes | Reviewing each remaining override against Bootstrap 5 class and variable changes | Low to moderate; overrides are few, but each one must be rechecked on every core release |
| Rewrite custom theme SCSS and templates | The brand depends on heavy layout work, custom page structure or many overridden templates | Rewriting SCSS for renamed utilities and updated components, then retesting every affected page | Moderate to high; large custom surface area means more breakage on each future update |
| Drop custom styling for core presets and settings | Brand needs are modest and the organization accepts Moodle's default look with a logo and colours | Mostly one-time review of branding settings and retirement of the old theme code | Low; the site tracks core styling, but some branding may look different after the change |
| Replace with a maintained third-party theme | A suitable theme exists, its maintainer supports your target Moodle version, and its licence and privacy terms are acceptable | Evaluating the theme, configuring it, and migrating existing branding and page layouts | Depends on the maintainer; vet release history, Bootstrap 5 support and exit options before committing |
How to plan and run the theme update
This sequence turns an unknown set of customizations into a tested, signed-off upgrade plan, so the production upgrade happens only after the theme and plugins have been proven on a copy of production.
Inventory theme, plugin and override code
The theme owner and a site administrator list every custom item: the child theme, SCSS and preset files, JavaScript modules, Mustache template and renderer overrides, local and activity plugins, web service functions and language customizations. Record each item's version, source location and owner, then mark whether a maintained third-party or core replacement exists. Keep the inventory in version control. This step is done when every item has a named owner and a keep, replace or remove decision.
Confirm target version and server requirements
Choose the target Moodle release and compare its requirements with your current servers before any code work begins. Moodle 5.1 requires 64-bit PHP 8.2 or later and lists supported databases, and Moodle 5.3 raises the minimums to PHP 8.3 or later, PostgreSQL 17, MariaDB 11.4 and SQL Server 2019 or later, and requires an existing site on Moodle 4.4 or later. Confirm your current version, the web root setting for the public directory and the database versions in use. This step is done when the infrastructure team signs off a list of every component that must change.
Read the release notes for Bootstrap 5 changes
A developer who knows the theme reads the Moodle release notes for the target version and the Bootstrap 5 upgrade notes in the Moodle developer documentation. Mark each change that touches classes, utility classes, JavaScript components, SCSS variables or the templates in your inventory. Note removals of core features, such as the Classic theme that Moodle 5.3 removes from core, so that any site relying on them has a decision recorded. This step is done when each finding is matched to an inventory item or recorded as not applicable.
Build a copy of production
The platform team restores a recent production database backup and a copy of the moodledata directory into a staging environment that matches production's PHP version, database engine, web server rules and cron setup. Personal data should be masked or replaced where policy requires it. Upgrade the core code on the copy first, then confirm that the site loads, cron runs and the admin notifications page shows no unexpected errors. This step is done when the copy behaves like production on the unchanged theme, so later failures can be traced to the theme changes.
Update theme styles and templates
The theme developer makes changes in the child theme only, never in core. Update SCSS variables and imports for Bootstrap 5, replace removed or renamed classes and utilities, and adjust template overrides that depend on changed markup. Rebuild the CSS, purge caches and check each preset and logo setting. Confirm that required page identifiers and regions still exist. This step is done when the theme compiles cleanly and a page-by-page visual review of the agreed page list shows no open style defects.
Fix JavaScript and plugin dependencies
The developer checks custom JavaScript modules, AMD code and any plugin scripts against the new Bootstrap 5 component behavior described in the release notes, such as changed data attributes or component initialization. Each third-party plugin is checked for a version that supports the target release. Where a plugin is unmaintained, the owner records a replacement or an exit plan. Browser console errors are reviewed on key pages. This step is done when the console is free of errors on the test list and every plugin has a confirmed compatible version.
Run the test plan on the copy
The QA lead runs a written test plan on the staging copy covering the main student, teacher and administrator journeys, theme pages across desktop and mobile widths, forms, grading screens, reports and any custom plugin pages or web service calls that integrations depend on. Testers record results against each case, and defects are logged with severity. Accessibility and keyboard navigation checks are included for the custom layouts. This step is done when every critical case passes, and the remaining defects have an agreed fix or accepted workaround signed off by the business owner.
Schedule the production upgrade
Once the test plan passes on the copy, the project owner schedules the production upgrade in a window agreed with the business and the platform team. The runbook lists a full backup of the database and moodledata, a snapshot of the code, the upgrade commands, the post-upgrade checks and a rollback path. Stakeholders are notified of the window. This step is done when the runbook has been rehearsed on the copy, the backup restore has been tested, and the owner has approved the go decision in writing.
How the theme update moves from staging to production
The path starts with an inventory of the custom theme and every local or third-party plugin that touches markup, styles or JavaScript. The target Moodle version is confirmed next, because it sets the PHP, database and document root requirements that the staging server must match. The theme and plugin changes are then made on a staging copy and pass through visual and functional tests. A go or no-go decision gates production cutover, and the rollback path, a tested restore of the pre-upgrade backup, must exist before that cutover starts.
Staging gates that a theme update must pass before production cutover, with the backup as rollback.
What the test plan must cover before production
Before a Bootstrap 5 theme reaches production, the test plan must prove that the pages people use every day still work, look right and behave correctly. Start with a page-by-page visual comparison of the current theme and the upgraded theme on a copy of production data. Cover the course page, a course with a Boost-based activity layout, the quiz attempt page, the assignment grading view, the gradebook, the user profile, and the main admin pages such as site administration, plugin overview and theme settings. Compare each page at the widths your users actually use, and check the custom navbar, footer, login page and any custom region or block placement. Layout drift from Bootstrap 4 utility classes that changed or were renamed in Bootstrap 5 is the most common visible failure, so record the page, the viewport and the result for every item.
The JavaScript-driven components need their own pass because they fail silently. Test dropdown menus, modals, collapsible course sections, the drawer that holds the course index and block drawer, tooltips, tabs in the administration pages, and any custom JavaScript your theme or local plugins add on top of the core modules. Check that each control opens, closes and keeps focus in the right place on a keyboard. Include the plugin screens you depend on, such as reports, the question bank, and any third-party block or activity plugin that renders its own markup. Run the same checks for students, teachers and administrators, because the set of visible controls and the capabilities behind them differ by role. Accessibility checks should use automated scanning plus manual keyboard and screen reader passes on the login, course and grading pages, and any custom template changes in the regression pass should be compared against your overridden template list.
Sign-off should sit with named people, not with the project team alone. The accessibility lead, a teacher representative, an administrator who owns the theme settings, and the owner of any affected plugin should each approve their area in writing. Keep the evidence: screenshots of the comparison pages with dates and the Moodle version and theme build tested, the defect log with each item marked fixed, retested or accepted with a stated reason, the automated scan reports, the role-based test scripts with results, and the regression results for each overridden template. Confirm with your Moodle administrator the exact upgrade path and minimum versions for your target release by checking the Moodle release notes before you schedule the production window, and agree a rollback step that restores the previous theme and a database backup taken immediately before the upgrade.
Security and operational considerations during the update
These four items decide whether the theme update is safe to run against real data. Each one protects a different part of the path from code review to a production rollback, so they should be settled in the plan before any staging work begins.
Vet third-party theme and plugin code
Every third-party theme, plugin or patch you carry forward is code that will run with access to your learners' data. Before it moves to the new Bootstrap 5 build, check its listing for a version that supports your target Moodle release, confirm the maintainer is still active, and review whether it overrides core templates or JavaScript in ways the upgrade will break. Record the result so the decision can be audited later. Ask the implementation partner to show the review, not just the outcome.
Plugin directory listingKeep staging data under production controls
A staging site that tests the theme against a recent copy of production is only useful if it is protected like production. Learner records, grades and personal data in the copy should be subject to the same accounts, roles, network limits and retention rules as the live system. Ask who can log in to staging, where its backups go, and when the copy is deleted or refreshed. A staging site with weaker access is a common route for personal data to leak during testing.
Point the web root at /public
From Moodle 5.1 onward, the web server document root must point to the new public directory rather than the main Moodle folder. If the server still serves the old path, the site may show directory listings or errors, and files that should stay private can become reachable. Update the virtual host on staging first, confirm that the theme assets and plugin files load from the expected paths, and check that the same change is in the production configuration before the cutover.
Prove rollback with a restorable pair
Rollback needs two things that match each other: a full database and data backup taken immediately before the upgrade, and the exact theme and plugin code version that ran on the previous release. Restoring one without the other leaves a site that either fails to start or shows an unstyled interface. Test the restore on a separate host, time it, and confirm that a learner can log in and open a course afterward. Keep both artifacts until the post-upgrade checks have passed for an agreed period.
Questions teams ask before updating a custom Moodle theme
How much effort does updating a custom Moodle theme for Bootstrap 5 take?
Effort depends mostly on how much of the theme rests on Bootstrap 3 or 4 class names, utilities and JavaScript behaviour, and how far the SCSS has moved away from the parent theme. A theme that is mostly settings, a light SCSS layer and a logo will need far less work than one with heavily styled course pages, custom dashboard blocks and hand-written jQuery. Moodle 5.0 is the release that moves core to Bootstrap 5, so every custom selector, data attribute and component call is a candidate for change. Ask any partner for a written inventory of the theme's templates, SCSS files and JavaScript before agreeing a fixed scope, because that inventory is what the quote should be based on.
Can an internal team update a custom Moodle theme without a partner?
Yes, if the team has someone who can read SCSS, Mustache templates and the relevant Bootstrap 5 documentation, and if they can run a staging copy of the production site. The work is mostly systematic: find each changed class and component, update it, rebuild the CSS, and test each page type. Teams without front-end experience in Moodle's build tooling, or without a staging environment, usually take longer and miss regressions in less visited pages such as reports or grading screens. A partner adds value mainly when the internal team lacks capacity for the testing pass or needs an outside review before sign-off.
What does the update need from our side?
The work needs access to the theme code in a version control repository, a staging site on the same Moodle version and database as production, and a copy of recent production data or a realistic set of test courses. It also needs a named business owner who can sign off the pages that matter most, such as the dashboard, course pages, login screens and any accessibility-sensitive pages. Test user accounts for each role (student, teacher, manager, administrator) are needed so that role-specific layouts can be checked. Agree in writing who approves the final result and what evidence they will review before production.
How long does testing take, and what sets that length?
Testing length is set by the number of distinct page types, roles and devices that the theme affects, and by how many defects each round finds. Typical drivers are the number of custom templates and overrides, the number of course formats in use, whether the site uses custom blocks or plugins that render their own Bootstrap markup, and how many people must review the results. Each defect found in testing usually means a fix, a rebuild of the CSS and a retest of the affected pages, so a theme with many small issues takes longer than one with a few large ones. Ask for the test plan and the list of page types it covers before agreeing a timeline.
Does a Boost child theme reduce the work of a Bootstrap 5 update?
A Boost child theme usually reduces the work because it limits how much of the theme depends on Moodle's own markup and styles. When a child theme keeps SCSS overrides small, relies on settings for logos and colours, and avoids copies of core templates, there are fewer places where Bootstrap 5 changes can break the design. It does not remove the need for testing, since any custom template override or JavaScript that references Bootstrap 4 behaviour still has to be checked. Teams with a heavily customised parent-style theme should expect more work than teams that already built on Boost, and should confirm which Moodle version the parent theme targets before planning.
Which parts of the theme are most likely to break?
The parts most often affected are custom templates that copy core Mustache markup, SCSS that targets Bootstrap class names or variables that have changed, and JavaScript that calls Bootstrap components through the older APIs. Utility classes used for spacing, alignment and visibility are also common sources of visual drift. Check any third-party plugin that renders its own markup, because it may depend on the same classes and will not be updated by the theme work. Confirm the exact list of changes against the Moodle 5.0 release notes and the Bootstrap migration guide during the inventory step rather than relying on memory.
How do we avoid breaking production during the upgrade?
Run the updated theme on a staging copy of the production site that uses the same Moodle version, the same plugins and a recent database copy, then keep production unchanged until sign-off. Record the baseline appearance of key pages before the change so reviewers can compare results, and keep the previous theme version available for rollback. Schedule the production change in a window that the business agrees, and confirm that a current backup exists before the change starts. Check that the server meets the requirements for the target Moodle version, including the PHP and database versions listed in the Moodle 5.0 release notes, before any theme work is deployed.
How DeployOpen scopes and delivers a Moodle theme update
DeployOpen approaches a Bootstrap 5 theme update as a written, fixed-scope piece of work on your own Moodle site. We inventory what your custom theme and plugins depend on, port them to the Bootstrap 5 markup, and prove the result in a staging copy before any change reaches production.
How we scope
- Inventory the custom theme, child theme settings, SCSS variables, templates and local plugins that touch Bootstrap classes or JavaScript
- Confirm the target Moodle version, PHP and database versions, and web server document root against the release notes
- Agree the written scope, deliverables and timeline before work starts, with ongoing support available as a retainer
How we build
- Replace deprecated Bootstrap 4 classes and utilities in templates, renderers and theme SCSS with their Bootstrap 5 equivalents
- Port custom JavaScript that relies on jQuery or Bootstrap 4 components to the Bootstrap 5 component API
- Keep overrides minimal and tracked so later Moodle core changes stay cheap to merge
How we hand over
- Deliver a test plan covering key pages, course formats, forms, grading views and mobile layouts, with results recorded
- Document every overridden template, SCSS variable and JavaScript change, with the reason for each
- Provide an upgrade runbook that sets out the order of staging tests, backups and production cutover steps
How we support
- Retest the theme against each Moodle minor release that your site adopts during the support period
- Review plugin updates that change templates or styles before they are applied to production
- Cover ongoing theme fixes, upgrades and continuous testing under a retainer agreed in writing

