没有不值得去解决的问题,也没有不值得去学习的技术!

WordPress Site Health Drops From 6 to 3 Recommendations: Clean Up Old Themes and Plugins, Disable Debug Logging and Comments

[Figure 1: WordPress Site Health before cleanup, with 6 recommended improvements]

作者:

在

Today I continued a systematic cleanup of the WordPress production site.

This time, the goal was not to turn every item in the backend green, but rather to use the WordPress “Site Health” page to re-examine themes, plugins, and configurations that had been left untouched for a long time.

When I first navigated to “Tools → Site Health”, the backend displayed a total of 6 “recommended improvements”.

[Figure 1: WordPress Site Health before cleanup, with 6 recommended improvements]
[Figure 1: WordPress Site Health before cleanup, with 6 recommended improvements]

These included:

  • You should remove inactive plugins
  • You should remove inactive themes
  • Outdated SQL server
  • Your site is set to log errors to a potentially publicly readable file
  • Comments are broken into pages
  • The permalink of your posts and pages does not contain the post name

These items do not mean the site is malfunctioning.

WordPress itself categorizes them as “recommended improvements” rather than critical issues. Therefore, the guiding principle this time was:

Clean up anything clearly identified as no longer useful; do not force changes involving production architecture, historical URLs, or major database versions just to clear a warning.

1. First, clean up unused old themes

The site currently uses Twenty Twenty-Five as its active theme.

The server previously retained the following:

  • Twenty Fifteen
  • Twenty Twenty-One
  • Twenty Twenty-Two
  • Twenty Twenty-Three
  • Twenty Twenty-Four

WordPress usually recommends keeping a backup default theme, but this holds little value for the current site.

Twenty Twenty-Five has undergone extensive layout and style adjustments via the Site Editor. Even if the active theme were to malfunction, I would not simply switch to another default theme to keep running in the production environment.

Therefore, I decided to keep only Twenty Twenty-Five and delete the other 5 unused themes.

Executed:

Bash
wp --allow-root theme delete twentyfifteen twentytwentyfour twentytwentyone twentytwentythree twentytwentytwo

Result:

Plaintext
Success: Deleted 5 of 5 themes.

After cleanup, only the currently active Twenty Twenty-Five remains on the server.

2. Evaluate unused plugins individually, rather than deleting everything labeled “inactive”

Handling plugins is much more complicated than handling themes.

Some plugins are currently deactivated but might be used again later; others are active but may no longer serve a practical purpose.

Therefore, instead of simply judging by “active” versus “inactive”, I verified the purpose of each plugin individually.

The deleted plugins included:

Plaintext
SyntaxHighlighter Evolved
GoLang Brush for SyntaxHighlighter Evolved
WP-Cumulus
Ad Inserter
Classic Editor
Focus Mode – Reading Experience Optimizer
Kill 429
Microsoft Clarity
Nimble Page Builder
AI Provider for Google
Secure SVG
Disable Google Fonts

A total of 12 plugins were cleaned up.

A few of these are worth noting specifically.

3. SyntaxHighlighter Evolved is officially retired

SyntaxHighlighter Evolved handled code highlighting for the blog for a long time.

However, the site has now migrated to Code Block Pro.

The code blocks in older posts have already been processed through previous migrations and compatibility adjustments, so there is no need to keep SyntaxHighlighter Evolved and its corresponding GoLang Brush.

These two plugins were deleted along with WP-Cumulus:

Bash
wp --allow-root plugin delete syntaxhighlighter golang-brush-for-syntaxhighlighter-evolved wp-cumulus

Result:

Plaintext
Success: Deleted 3 of 3 plugins.

This marks the official conclusion of the long-running cleanup of SyntaxHighlighter Evolved.

4. Remove backend tools that no longer have a use case

Next, I deleted:

Plaintext
Ad Inserter
Classic Editor
Focus Mode – Reading Experience Optimizer
Kill 429
Microsoft Clarity
Nimble Page Builder

These plugins either corresponded to features that had already been discontinued or were no longer used in the current site architecture.

After execution:

Plaintext
Success: Deleted 6 of 6 plugins.

Additionally, AI Provider for Google and Secure SVG no longer need to remain active.

So I deactivated and then deleted them:

Bash
wp --allow-root plugin deactivate ai-provider-for-google secure-svg
wp --allow-root plugin delete ai-provider-for-google secure-svg

5. Disable Google Fonts can also be retired

This plugin is rather unique.

It originally existed to prevent pages from loading Google Fonts.

For websites whose primary traffic comes from mainland China, relying directly on Google Fonts has always caused loading failures or delays.

However, upon re-inspecting the frontend, I found that even if Disable Google Fonts is temporarily deactivated, the page does not actually load:

Plaintext
fonts.googleapis.com
fonts.gstatic.com

This means the current Twenty Twenty-Five theme and existing site configuration no longer depend on remote Google Fonts.

Therefore, keeping this plugin no longer serves any practical purpose.

I ultimately deleted it as well.

Even if I use special fonts again in the future, I still prefer using the WordPress font library or local hosting rather than relying on remote Google Fonts.

6. Some plugins are temporarily unused but kept anyway

This time, I did not delete every tool just to make the plugin list shorter.

For example, Better Search Replace is still occasionally used for production maintenance, so I kept it.

Regenerate Thumbnails was also kept.

However, this process also confirmed one thing:

Regenerate Thumbnails is not an image compression plugin.

Its primary function is to regenerate thumbnails based on the image sizes currently registered in WordPress; it does not automatically compress multi-megabyte original JPGs or PNGs into smaller files.

Therefore, although the site does have some multi-megabyte historical original images, there is no need to run a full-site Regenerate Thumbnails today solely to improve site speed.

Especially since the homepage now correctly outputs responsive images and srcset, the browser is not simply loading the original large images everywhere.

Thus, I kept this tool but chose not to run a bulk regeneration for now.

7. WP-PageNavi confirmed to still be in use

WP-PageNavi was initially a difficult plugin to evaluate.

I did not find any obvious calls to it in the theme or MU plugins, so I suspected it might no longer be useful.

But after directly checking the production homepage and the second page, I found that the frontend HTML still contains:

Plaintext
page-numbers
page-numbers current
page-numbers dots
wp-pagenavi

Thus, it can be confirmed:

WP-PageNavi is still involved in frontend pagination for the production site.

This plugin was kept.

8. Cloudflare plugin remains deactivated for now

After cleanup, only one regular plugin remained deactivated:

Plaintext
cloudflare

The Cloudflare plugin is currently disabled primarily because the site has split into different domains such as www, en, and admin, making the caching and CDN architecture much more complex than before.

There is no need to forcibly re-enable it right now just to clear one more warning in Site Health.

I am also not in a hurry to delete it.

Therefore, WordPress still displays the warning:

Plaintext
You should remove inactive plugins

This is a warning with a clearly understood cause that I have actively accepted.

9. Update Akismet to the latest version

After finishing the plugin cleanup, I reviewed the plugin list again and found that Akismet was the only plugin with an available update:

Plaintext
akismet  5.7.1  available

So I executed:

Bash
wp --allow-root plugin update akismet

Upgrade result:

Plaintext
Plugin updated successfully.
Success: Updated 1 of 1 plugins.

akismet  5.7.1 → 5.7.2

At this point, all 20 currently active plugins are up to date.

10. Disable the WordPress debug log that no longer needs to be on long-term

Another security warning in Site Health was:

Plaintext
Your site is set to log errors to a potentially publicly readable file

Checked the current configuration:

Bash
wp --allow-root eval 'foreach (["WP_DEBUG","WP_DEBUG_LOG","WP_DEBUG_DISPLAY","SCRIPT_DEBUG","SAVEQUERIES"] as $c) { echo $c."=".(defined($c) ? var_export(constant($c), true) : "未定义").PHP_EOL; }'

Result:

Plaintext
WP_DEBUG=true
WP_DEBUG_LOG='/data/wwwroot/www.shuijingwanwq.com/wp-content/slytranslate-debug.log'
WP_DEBUG_DISPLAY=false
SCRIPT_DEBUG=false
SAVEQUERIES=undefined

Further inspection of wp-config.php:

Plaintext
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', __DIR__ . '/wp-content/slytranslate-debug.log' );
define( 'WP_DEBUG_DISPLAY', false );

This log was previously used for troubleshooting the SlyTranslate and WordPress translation pipeline.

However, those issues have mostly stabilized, and there is no need to keep WP_DEBUG=true enabled long-term on the production site.

Therefore, I backed up wp-config.php first, and then changed it to:

Plaintext
WP_DEBUG=false
WP_DEBUG_LOG=false
WP_DEBUG_DISPLAY=false

After checking again:

Plaintext
WP_DEBUG=false
WP_DEBUG_LOG=false
WP_DEBUG_DISPLAY=false

This Site Health warning subsequently disappeared.

11. Re-evaluate whether the comment feature still needs to remain open

There was also a warning in Site Health from Yoast SEO:

Plaintext
Comments are broken into pages

Checked the current configuration:

Plaintext
page_comments = 1
comments_per_page = 50
default_comments_page = newest

This means the site did have comment pagination enabled.

However, while investigating further, I began to reconsider a more fundamental question:

Is it still necessary to keep article comments open on this site?

The site currently uses page caching, with a CDN in front of it.

Comments are a dynamic feature requiring real-time writing and display, whereas page caching and CDNs are designed to minimize origin requests and reuse pages for as long as possible.

After a comment is submitted, if the page cache or CDN still serves an old version, visitors will likely not see the newly submitted content.

Of course, a separate cache-clearing mechanism could be designed specifically for comments, but that would mean maintaining an additional cache invalidation pipeline.

Meanwhile, I have already kept Contact Form 7, and I plan to provide a more accessible contact entry from project pages like go-dev in the future.

Therefore, the necessity of the comment feature itself has significantly diminished.

12. Recent “comments” were actually all Pingbacks

To avoid deleting genuine reader interactions, I first checked the most recent 20 approved comments.

At first glance, there seemed to be quite a few, and they all occurred on the same day.

However, the author names were very strange; almost all of them were post titles.

After adding comment_type to the inspection, the results were very clear:

Plaintext
pingback
pingback
pingback
pingback
...

The most recent 20 were all Pingbacks.

In other words, these were not comments left by real visitors under the posts.

This further solidified the decision to turn off the comment feature.

13. Disable comments and Pingback/Trackback for all posts and pages

I ultimately adjusted both the default configuration and the existing content.

Comments are disabled by default for new posts and pages:

Plaintext
default_comment_status = closed
default_ping_status = closed

At the same time, I bulk-disabled them for existing posts and pages:

Plaintext
comment_status = closed
ping_status = closed

Execution result:

Plaintext
Number of posts/pages with comments and Pingback/Trackback closed: 2909

One crucial point here:

I only closed the entry point; no historical comment data was deleted.

Subsequent verification:

Plaintext
default_comment_status=closed
default_ping_status=closed
Posts/pages with comments still open=0
Posts/pages with Pingback/Trackback still open=0

Therefore, the current state is very clear:

New posts will not have comments enabled by default, all existing posts have been closed, and Pingbacks and Trackbacks are entirely disabled, yet historical comments in the database remain fully intact.

14. Disable comment pagination simultaneously

Since the comment entry point has been shut down entirely, keeping the comment pagination setting is also meaningless.

Executed:

Bash
wp --allow-root option update page_comments 0

Result:

Plaintext
Success: Updated 'page_comments' option.

The Yoast SEO warning:

Plaintext
Comments are broken into pages

Subsequently disappeared from Site Health as well.

15. Did not flush the entire site cache for immediate effect

There is another production operations detail worth recording here.

After comments were disabled, I could theoretically flush W3 Total Cache to force all pages to regenerate immediately.

But I ultimately chose not to do so.

The reason is that this site already has a large number of historical pages.

Executing a full cache flush would cause a massive number of pages to re-query the origin and regenerate in a short period. Combined with CDN cache invalidation, this could easily trigger a noticeable CPU spike.

The server already has a CPU alerting mechanism in place, so there is absolutely no need to proactively generate this load just to make a comment entry point—already disabled at the database level—disappear immediately.

So I continued with the approach of:

Letting old page caches expire naturally.

This was a very important principle throughout today’s cleanup process:

In a production environment, “seeing the change immediately” is not always more important than “completing the change smoothly and naturally”.

16. The MySQL 5.7 warning is left unresolved for now

Site Health also shows one more item:

Plaintext
Outdated SQL server

Checked the database version:

Bash
wp --allow-root eval 'global $wpdb; echo "数据库服务器版本:".$wpdb->db_version().PHP_EOL;'

Result:

Plaintext
Database server version: 5.7.32

The site currently uses Alibaba Cloud RDS.

Therefore, this is no longer an issue that can be resolved by modifying WordPress configuration; it involves a major version upgrade of the RDS database.

MySQL 5.7 is indeed quite old, but a database upgrade requires considering:

  • WordPress and plugin compatibility
  • RDS upgrade path
  • Database backup
  • Rollback plan
  • Upgrade window
  • Production business impact

There is no need to rush a major database version upgrade today just to clear one yellow warning from Site Health.

So this item is explicitly documented but left unresolved for now.

17. Permalinks are also not modified just to satisfy an SEO warning

The remaining warning from Yoast SEO is:

Plaintext
The permalink of your posts and pages does not contain the post name

Checked the current WordPress permalinks:

Bash
wp --allow-root option get permalink_structure

Result:

Plaintext
/%year%/%monthnum%/%day%/%post_id%/

For example, a post URL currently looks like:

Plaintext
/2026/08/19/xxxxx/

Whereas Yoast recommends:

Plaintext
/%postname%/

Or at least including %postname% in the URL.

But for a site that has been running for years, with a large number of historical posts and search engine indexes, this recommendation cannot be followed mechanically.

Changing the permalink structure now would involve:

  • Massive changes to historical URLs
  • 301 redirects
  • Reprocessing by search engines like Google and Bing
  • Existing external links
  • Historical links on social platforms
  • WordPress internal links
  • CDN cache
  • SEO fluctuations

In comparison, the theoretical SEO benefit of “including the post name in the URL” is far from enough to offset the risks of a site-wide URL migration.

So for this item, I explicitly chose:

Keep the existing permalink structure; do not modify it.

18. Ultimately reduced from 6 recommended items to 3

After completing the above cleanup, I went back to WordPress Site Health.

[Figure 2: WordPress Site Health after cleanup, with only 3 recommended improvements remaining]
[Figure 2: WordPress Site Health after cleanup, with only 3 recommended improvements remaining]

The original 6 items have been reduced to 3.

The resolved items are:

Plaintext
You should remove inactive themes
Your site is set to log errors to a potentially publicly readable file
Comments are broken into pages

The remaining ones are:

Plaintext
You should remove inactive plugins
Outdated SQL server
The permalink of your posts and pages does not contain the post name

And all 3 of these are now consciously retained.

The first is the Cloudflare plugin, which is temporarily kept deactivated.

The second is that the current Alibaba Cloud RDS is still running MySQL 5.7.32; the major database version upgrade will be planned separately later.

The third is the decision not to modify the existing permalink structure, in order to maintain the stability of historical URLs accumulated over the years.

Therefore, this time I did not continue pursuing:

Plaintext
0 recommended improvements

But rather stopped at:

Plaintext
3 recommended improvements

19. Site Health is not a task list that “must be zeroed out”

After this cleanup, my understanding of WordPress Site Health has become clearer.

It is more like a:

Checklist that requires human judgment.

Some warnings are very much worth addressing, such as:

  • Abandoned themes
  • Abandoned plugins
  • Production debug logs left on long-term
  • Comment pagination that is no longer needed

But other warnings can only serve as suggestions, such as:

  • Major database versions
  • Permalink design
  • Temporarily deactivated plugins for special purposes

If I were to upgrade the database, change all site URLs, or even disrupt the existing production architecture just to make the backend look “perfect”, I would be putting the cart before the horse.

So what I ended up with today is not a backend where “all yellow warnings have vanished”.

Rather, it is a much clearer state:

Which issues have been truly resolved, and which warnings have been actively accepted after careful evaluation.

For a long-running production WordPress site, I believe the latter is more important than simply chasing a pretty Site Health score.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系