Skip to content

WordPress theme management at scale across cPanel accounts via WHM

Managing WordPress themes across many cPanel accounts on the same WHM server — inventory, updates, removing abandoned themes, and the security implications of unused themes.

Themes are the quieter sibling of plugins for fleet management. Sites usually have only one active theme but five or six installed, including leftovers from past redesigns, “just in case” copies, and the WordPress default themes that ship with each release. Each one is code on disk, each one is a potential CVE, and most of them are doing nothing useful.

What’s happening

WordPress only loads the active theme. Inactive themes sit on disk but aren’t executed at request time. That makes them lower-risk than inactive plugins — they don’t run code by default — but not zero-risk. A theme with a CVE that processes URL parameters can sometimes be reachable via direct access to the theme’s PHP files in wp-content/themes/<name>/. Some themes register admin endpoints that fire regardless of activation. And unused themes are clutter that makes audits harder.

How to verify

Server-side enumeration:

for wp_path in $(find /home -name 'wp-config.php' -maxdepth 4 2>/dev/null); do
  site_dir=$(dirname "$wp_path")
  user=$(stat -c %U "$wp_path")
  sudo -u $user wp --path="$site_dir" theme list --field=name,version,status --format=csv
done

The result tells you which themes are active, which are installed-but-inactive, and which have updates available.

The fix

  1. Inventory. The same script as for plugins, output to CSV. Sort by theme name to find duplicates and outliers.

  2. Per-site cleanup. For each WordPress install, the right state is: one active theme (or two if you use a parent + child), plus one fallback (the current WordPress default — twentytwentyfour at the time of writing), nothing else. Delete the rest:

    wp --path=/home/user1/public_html theme list --status=inactive --field=name | while read theme; do
      wp --path=/home/user1/public_html theme delete $theme
    done

    Don’t delete the fallback. Leave the WordPress default theme in place — if the active theme breaks, WordPress falls back to it.

  3. Update the active theme. Theme updates are less frequent than plugin updates but more dangerous when they happen — a theme update can ship a new layout that breaks how content is displayed. Test on staging first, especially for premium themes (Avada, Divi, Elementor Hello, Astra Pro).

    wp --path=/home/user1/public_html theme update --all
  4. Custom child themes. These are the ones you wrote and they don’t auto-update. They sit on disk indefinitely. Track them separately — they need security review like any custom code. Common issues:

    • Hardcoded HTTP URLs.
    • Direct database queries that don’t escape input.
    • Includes of files based on user input without validation.
  5. Parent themes for child themes. If a site uses a child theme of “Generatepress”, make sure the parent is installed AND updated. Deleting an inactive theme that’s actually a parent breaks the child.

  6. Premium themes (Avada, Divi, Elementor Pro, Astra Pro, etc.) often have their own update mechanism that’s separate from WordPress.org. Each has a license key per site. Inventory those separately — when a license lapses, the theme stops getting updates and silently becomes a CVE risk.

  7. Theme directory permissions. Themes live in wp-content/themes/. Standard permissions: 755 for directories, 644 for files. wp-content/themes/<name>/style.css should be 644, not 666. Tighten if loose:

    find ~/public_html/wp-content/themes/ -type d -exec chmod 755 {} \;
    find ~/public_html/wp-content/themes/ -type f -exec chmod 644 {} \;
  8. For a managed cPanel fleet, theme management is part of the same cadence as plugin management. Stack Harbor handles both under managed cPanel operations.

Stack Harbor operates production WordPress at scale — see enterprise WordPress hosting for the managed model, or book a WordPress consult for a written read of your current shape.