13.7. Updating a Theme

Last updated on
14 April 2025

Goal

Update a contributed theme on your site and run the Database Updates script.

Site prerequisites

Steps

You can use the administrative interface or Drush to update a contributed theme. If you are updating a custom theme rather than a contributed theme, if you see a message saying Installing modules and themes requires FTP access to your server, or if the steps below do not work to obtain the new theme files, follow the steps in Secció 11.6, «Manually Downloading Module or Theme Files», and then continue with step 6 in the instructions for administrative interface below.

Using the administrative interface

  1. Put your site in maintenance mode. See Secció 11.2, «Enabling and Disabling Maintenance Mode».
  2. In the Manage administrative menu, navigate to Reports > Available updates > Update (admin/reports/updates/update).
  3. Find and check the theme in the list. Click Download these updates for the theme.

    Available updates

  4. Click Continue.
  5. Click Run database updates. If you obtained the new theme files manually, start with this step, and reach the database updates page by typing the URL example.com/update.php in your browser.
  6. Click Continue to run the updates. The database update scripts will be executed.
  7. Click Administration pages to return to the administration section of your site.
  8. Take your site out of maintenance mode. See Secció 11.2, «Enabling and Disabling Maintenance Mode».
  9. Clear the Drupal cache (refer to Secció 12.2, «Clearing the Cache»).

Using Drush

  1. Find the project name for the theme you wish to update, which is the last segment of the theme’s project page URL. For example, if the project URL is https://www.drupal.org/project/mayo, the project name is "mayo".
  2. Run the following Drush command, giving the project name (for example, mayo) as a parameter:

    drush up mayo
  3. Follow the instructions on the screen.

Expand your understanding

Attributions

Written by Boris Doesborg.

 

This page is generated from AsciiDoc source from the User Guide. To propose a change, edit the source and attach the file to a new issue in the User Guide project. PDF and e-book formats are available on the User Guide project page.

Source file: security-update-theme.asciidoc

Help improve this page

Page status: No known problems

You can: