---
# How remove caps-lock from WordPress comments (retroactively)

**URL:** https://modul-r.codekraft.it/2021/12/how-remove-caps-lock-from-wordpress-comments-retroactively/
Date: 2021-12-08
Author: Erik
Post Type: post
Summary: There are people, sometimes whole departments of companies, who from the day they buy a keyboard to when they throw it away keep the caps-lock on. I don’t understand them and for this reason i made a plugin to convert everything they write to the correct case. It may come in handy if you have […]
Categories: Blog
Featured Image: https://modul-r.codekraft.it/wp-content/uploads/2021/12/pexels-photo-735911.webp
---

There are people, sometimes whole departments of companies, who from the day they buy a keyboard to when they throw it away keep the caps-lock on. I don't understand them and for this reason i made **a plugin to convert everything they write to the correct case**.

It may come in handy if you have a blog and some people leave you comments in caps lock, this way you can make comments written in capital letters lower case. Or if you've inherited a cooking blog written in all caps and want to do something about readability

[download **CLICK TO DOWNLOAD** THIS PLUGIN FROM THE WORDPRESS DIRECTORY (JUST KIDDING)](https://wordpress.org/plugins/remove-capslock/)

**HOW IT WORKS**

After installation, the plugin automatically displays normalised texts. So the title, post content, widget titles and comments will be filtered and normalised by default.

You can customize/add/remove filters adding to functions.php the **name of the hook** and the **number of allowed consecutive uppercase characters**.

this is the method to **create your own set** of hook+rule

```
add_action( 'init', function() {
    add_filter( 'rcl_hook_filters', function () { return array(
        array( 'hook' => 'the_title', 'allowed_chars' => 6 ), // title
        array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // comments
        array( 'hook' => 'widget_title', 'allowed_chars' => 6 ), // widget
        );
    } );
} );
```

But what if I want to apply it only to comments?

```
add_filter( 'rcl_the_content', function () { return -1; } ); // disabled
add_action( 'init', function() {
    add_filter( 'rcl_hook_filters', function () { return array(
        array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // 2 or more uppercase digits triggers the text normalization
        );
    } );
} );
```

that's it, anyhow I hope your comments to this post are lowercased :P

---

## Categories

- Blog

---

## Navigation

- [Home](https://modul-r.codekraft.it/)
- [Theme Setup](https://modul-r.codekraft.it/2019/06/theme-setup/)
- [Environment Setup](https://modul-r.codekraft.it/2019/06/environment-setup/)
- [Functions and Components](https://modul-r.codekraft.it/2019/06/custom-theme-functions/)
- [Classic](https://modul-r.codekraft.it/category/classic/)
- [Shop](https://modul-r.codekraft.it/shop/)
- [Tag /Archive format](https://modul-r.codekraft.it/tag/post-formats/)
- [Modul R](https://wordpress.org/themes/modul-r/)
- [Modul R (git)](https://github.com/erikyo/Modul-R)
- [Modul R Child (git)](https://github.com/erikyo/Modul-R-child)
- [CF7 Antispam](https://wordpress.org/plugins/cf7-antispam/)
- [OH-MY-SVG](https://modul-r.codekraft.it/oh-my-svg/)
- [Model-Viewer WordPress block](https://modul-r.codekraft.it/model-viewer-wordpress-block/)
- [Remove Capslock](https://wordpress.org/plugins/remove-capslock)
- [Blog](https://modul-r.codekraft.it/category/random-access-memories/)
- [Codekraft](https://github.com/codekraft-studio)
- [About Me](https://modul-r.codekraft.it/erik-golinelli/)
- [Contact](https://modul-r.codekraft.it/contacts/)
- [Credits](https://modul-r.codekraft.it/credits/)

---

## Footer Links

- [Theme Setup](https://modul-r.codekraft.it/2019/06/theme-setup/)
- [Functions and Components](https://modul-r.codekraft.it/2019/06/custom-theme-functions/)
- [Environment Setup](https://modul-r.codekraft.it/2019/06/environment-setup/)
- [Download](https://wordpress.org/themes/modul-r/)
- [Contact form 7](https://modul-r.codekraft.it/category/contact-form-7/)
- [Quick Start](https://modul-r.codekraft.it/category/quick-start/)
- [Classic](https://modul-r.codekraft.it/category/classic/)
- [Post Formats](https://modul-r.codekraft.it/category/post-formats/)
- [Block](https://modul-r.codekraft.it/category/block/)
- [Clothing](https://modul-r.codekraft.it/product-category/clothing/)
- [Privacy Policy](https://modul-r.codekraft.it/privacy-policy/)
- [Proudly powered by WordPress & made in Bologna with ♥ by Codekraft](https://codekraft.it/)