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

**URL:** https://modul-r.codekraft.it/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/06/25287_Helicopter_landing_composite-web-scaled.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

- [Modul*R](https://modul-r.codekraft.it/)

---

## Footer Links

- [WordPress](https://wordpress.org/)