Script to call wp-admin/themes.php on each blog?

After several iterations of dumping themes in and out of the themes directory, I made the decision some time back to go with the WPMU Theme Pack and haven’t looked back since.

This has been a great decision, but unfortunately one consequence has meant users with old themes now have broken sites. I have no idea what themes these users had setup on their sites, so finding the broken themes and fixing them doesn’t seem attractive. Besides, I don’t want them to be available for use any longer.

What does seem attractive however, is finding a way to load each site’s theme backend page, at subdomain.domain.tld/wp-admin/themes.php. Doing this gets WP to fix the issue by reverting to the default theme.

I’m wondering if anyone out there might be aware of a plugin or script I could run when logged in as admin to go through each blog and load the theme selection dashboard page to fix all the broken blogs.

Any ideas?

  • Suleiman
    • New Recruit

    Thanks for the post Xavier, but I’m not sure how defining a default theme would fix the issue. The issue is not that the default theme is broken, the issue is that the users’ old theme files were deleted and those themes are now broken.

    Loading the wp-admin/themes.php page on a site where the theme was broken fixes the problem, as mentioned above, by switching the theme to the default theme, Twenty Eleven. I need a way to do that for each of the 3000+ sites on my install since otherwise, I don’t have a way to fix those broken sites.

  • Arun Basil Lal
    • New Recruit

    Hey @Suleiman

    I am not sure, but this logically seems to work:

    – Temporarily delete all themes but the Twenty Ten theme

    – Network activate the twenty Ten theme. This will activate the theme on all subsites I believe.

    – Bring back all the other themes.

    I hope this works. Let me know.