PHPackages                             codelight-eu/codelight-wp-cleanup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. codelight-eu/codelight-wp-cleanup

ActiveWordpress-plugin

codelight-eu/codelight-wp-cleanup
=================================

Remove various unneeded functionality from your WP installation.

v1.2(8y ago)162864The UnlicensePHP

Since Mar 4Pushed 7y ago8 watchersCompare

[ Source](https://github.com/codelight-eu/codelight-wp-cleanup)[ Packagist](https://packagist.org/packages/codelight-eu/codelight-wp-cleanup)[ Docs](http://codelight.eu)[ RSS](/packages/codelight-eu-codelight-wp-cleanup/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

wp-cleanup
==========

[](#wp-cleanup)

Wordpress comes with a bunch of features that are rarely needed when WP is used more as a content management system instead of a blogging platform. This can lead to broken archive pages, admin dashboard bloat and even a couple of small security concerns.

This plugin provides an easy way to selectively disable most of the stuff I've found to be useless in a CMS context.

Note that this plugin has *not* been tested thoroughly - patches and issues are welcome.

Todo:

- Review and fix removing Comments;
- Remove comments icon from admin bar;
- Allow moving Menus to a separate top-level menu item (i.e. instead of Appearance);
- Allow bulk registering options (instead of a ton of separate add\_theme\_support() calls);
- Remove 'widgets' link from admin bar;
- Refactor architecture;
- Refactor to use PSR-2.

Summary
=======

[](#summary)

The plugin provides filters to easily:

- Disable specific widgets;
- Disable Categories, Tags and specific archive pages (e.g. Author, Date, Attachment)

You can also enable the following:

- Remove admin bar and restrict dashboard access for users without the 'edit\_posts' capability;
- Remove comment support from 'post' and 'page' post types; remove all (most?) comment-related stuff from admin;
- Disable feeds;
- Disable the search functionality.

And by default, the plugin:

- Restricts TinyMCE styles dropdown to &lt;p&gt;, &lt;h2&gt;, &lt;h3&gt;, &lt;h4&gt;;
- Disables XML-RPC;
- Hides update notifications for non-admin users;
- Removes Quick Press dashboard widget;
- Removes "Tools" from the dashboard menu for non-admin users;
- Removes Appearance &gt; \[Themes, Customize, Header, Background\] from the dashboard menu for non-admin users;
- Removes a bunch of useless widgets;
- Limits post revisions to 5 (unless explicitly defined elsewhere);
- Adds the X-UA-Compatible http request header.

Configuration
=============

[](#configuration)

Everything below goes into your theme's *functions.php*

To enable the plugin:

```
add_theme_support('cl-wp-cleanup');

```

Without this, the plugin does nothing.

### Disable customizer

[](#disable-customizer)

```
add_theme_support('cl-disable-customizer');

```

### Disable categories / tags / archives

[](#disable-categories--tags--archives)

Even if date / author / attachment archive templates do not exist, Wordpress will still render those pages using the default template, which can result in those pages being visually broken. These broken or simply unused pages may be indexed by search engines.

To disable specific archives:

```
add_filter('cl_remove_archives', function($types) {
    return array('author', 'date', 'attachment');
});

```

Valid arguments are:

- 'archive' to remove *all* Archives and also Category and Tag taxonomies (basically everything below);
- 'category' to remove Category archives and the Category taxonomy;
- 'tag' to remove Tag archives and the Tag taxonomy;
- 'author' to remove the Author archives;
- 'date' to remove the Date archives;
- 'attachment' to *redirect* all attachment pages to their parent pages, or to the front page when the attachment is not attached to any specific page.

By default, nothing is removed.

### Disable search

[](#disable-search)

Remove all search-related functionality.

```
add_theme_support('cl-remove-search');

```

### Disable widgets

[](#disable-widgets)

To clean up some of the less useful default widgets:

```
add_filter('cl_remove_widgets', function($widgets) {
    return array('misc', 'blog');
});

```

Valid arguments are:

- 'all' to completely remove the Widgets page from WP Admin;
- 'misc' to remove Pages, Calendar, Links, Meta, Tag Cloud widgets;
- 'blog' to remove blog-related widgets: Archives, Categories, Recent Posts, RSS;
- or an array of specific widget class names - the full list is available in the [Codex](http://codex.wordpress.org/Function_Reference/unregister_widget)

By default, 'misc' widgets are removed.

### Restrict dashboard access

[](#restrict-dashboard-access)

For users who don't have 'edit\_posts' capability, redirects dashboard to front page, disables the admin bar and redirects to front page after login.

To enable:

```
add_theme_support('cl-restricted-dashboard-access');

```

### Remove comments

[](#remove-comments)

Removes comment support from Posts and Pages, hides Comments from the menu, removes Comments from admin bar and removes the Recent Comments dashboard widget.

To enable:

```
add_theme_support('cl-remove-comments');

```

### Admin cleanup

[](#admin-cleanup)

For all non-admin users, this feature:

- Hides update notifications
- Removes the following pages from admin:
    - Appearance &gt; Themes
    - Appearance &gt; Header
    - Appearance &gt; Background
- Removes Quick Press dashboard widget

This is just a small cleanup to the admin interface.

Note that non-admin users do not have access to the Appearance menu item by default anyway. This feature is useful when the client has a role other than Administrator but still requires access to Widgets and Menus.

To disable admin cleanup:

```
add_theme_support('cl-disable-admin-cleanup');

```

### Remove feeds

[](#remove-feeds)

Disables feeds. Note that it doesn't remove various feed links from the head - this needs to be done manually.

```
add_theme_support('cl-remove-feeds');

```

### Remove Tools menu item

[](#remove-tools-menu-item)

The Tools menu item is hidden by default.

To re-enable Tools:

```
add_theme_support('cl-enable-tools');

```

### Clean up TinyMCE

[](#clean-up-tinymce)

Restrict the TinyMCE styles dropdown to only have &lt;p&gt;, &lt;h2&gt;, &lt;h3&gt; and &lt;h4&gt;.

To disable:

```
add_theme_support('cl-disable-tinymce-cleanup');

```

### XML-RPC

[](#xml-rpc)

Disabled by default, as it's a [potential attack vector](http://blog.spiderlabs.com/2014/03/wordpress-xml-rpc-pingback-vulnerability-analysis.html). To enable:

```
add_theme_support('cl-enable-xmlrpc');

```

### Post revisions

[](#post-revisions)

To reduce database bloat, the number of post revisions is set to 5, unless explicitly defined. To set a custom number, simply override WP\_POST\_REVISIONS.

### X-UA-Compatible header

[](#x-ua-compatible-header)

Sets the X-UA-Compatible header to force IE to *not* use compatibility mode. Read more in [this stackoverflow thread](http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge-e)

### Disable plugin update checks

[](#disable-plugin-update-checks)

To speed up the load of plugins page, disable plugin update checks. This is useful if you're using a composer-based setup anyway.

```
add_theme_support('cl-disable-plugin-update-check');

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~194 days

Total

4

Last Release

3138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/014813826797ac3011077a92f41d74ae92eb8dae62cb8ea7d6def18947918039?d=identicon)[indrek\_k](/maintainers/indrek_k)

---

Top Contributors

[![indrek-k](https://avatars.githubusercontent.com/u/1229164?v=4)](https://github.com/indrek-k "indrek-k (14 commits)")[![zimdin12](https://avatars.githubusercontent.com/u/18162148?v=4)](https://github.com/zimdin12 "zimdin12 (9 commits)")[![toktor](https://avatars.githubusercontent.com/u/19283835?v=4)](https://github.com/toktor "toktor (1 commits)")

---

Tags

pluginwordpress

### Embed Badge

![Health badge](/badges/codelight-eu-codelight-wp-cleanup/health.svg)

```
[![Health](https://phpackages.com/badges/codelight-eu-codelight-wp-cleanup/health.svg)](https://phpackages.com/packages/codelight-eu-codelight-wp-cleanup)
```

###  Alternatives

[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47078.8k](/packages/sybrew-the-seo-framework)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

263.7k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
