How to Redact Text in WordPress (The Easy Way)

Do you want to redact text on your WordPress website?

Redaction can be a way to share information with your visitors without hurting anyone’s privacy. You can even use it as an unusual paywall or a game where you challenge visitors to fill in the missing words.

In this article, we will show you how you can redact text in WordPress.

How to redact text in WordPress

Why Redact Text in WordPress?

Redaction is where you edit text by blacking out sensitive parts of it. It is a way to share information and documents with the general public while keeping confidential and sensitive information private.

Redaction can help you share real world examples without breaking your privacy policy. For example, if you’re showing visitors how to write a great CV then you might want to include a few examples of real CVs you’ve received. You can use redaction to block out each applicant’s name, address, and other personal information.

When you redact text, that content still exists in your WordPress dashboard. This means you can easily remove the redaction at any point.

Redaction can also be an eye-catching way to preview the kind of content visitors can expect when they sign up to your WordPress membership site. Visitors can then buy a membership to remove the redaction and enjoy the full, uncensored version.

That being said, let’s see how you can easily redact text on your WordPress website.

How to Redact Text in WordPress

The easiest way to redact text in WordPress is by using Eyes Only. This plugin will replace any redacted text with a black block.

An example of redacted text on a WordPress website

If the visitor highlights the block, then they’ll simply see the word REDACTED in white letters.

You can see an example of how this might look in the following image.

An example of redacted text

Another option is to automatically replace any word or phrase with an alternative chosen by you. For example, if you can’t use a client’s name on your small business website then you might replace the information with a more vague word such as ‘client.’

First, you’ll need to install and activate the plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you can redact any text by editing the HTML in the WordPress code editor. To get started, simply open the page or post.

Then, click on the dotted icon in the top right corner and click on ‘Code editor.’

The WordPress code editor

Next, find the piece of text that you want to redact. At the start of the text, type in the following tag:

[redact]  

At the end of the redacted text, type in:

[/redact]  

In the following image, we’re redacting ‘the Recipient.’

The WordPress code editor

To redact more text just follow the same process described above.

If you want to switch back to the default plain text block editor at any point, then simply click on ‘Exit code editor.’

Exiting the WordPress code editor

After adding tags to all the text that you want to redact, you can go ahead and publish or update the page.

Just be aware that the text won’t appear redacted while you’re logged into your WordPress account. To check that the text is redacted, you’ll either need to log out of your account or visit the page in an incognito tab in your web browser.

Another option is to automatically replace specific words with alternative words. This is useful if there’s a word that you never want to show on your site, such as the name of a confidential supplier or customer.

By configuring the plugin to automatically redact a word, you can make sure that information never shows up on your website. This automated workflow can also save you a lot of time and hard work.

Since it replaces each redacted word with an alternative word, this method can also make your pages easier to read and nicer to look at, particularly when compared to a page that has lots of blacked-out content.

To redact a word or phrase automatically, head over to Settings » Eyes Only. Then, go ahead and click on the ‘Add new’ button.

Creating a redaction rule in WordPress

In the new ‘Text’ field, simply type in the text that you want to redact automatically. Just be aware that the text replacement is case sensitive.

In the ‘Replacement’ field, type in the text that you want to show instead of the redacted text.

In the following image, we’re replacing ‘Jane Smith’ with ‘Our Client.’

The Eyes Only redaction WordPress plugin

You can then go ahead and click on the ‘Add’ button.

If you want to automatically replace more words or phrases, then simply repeat the process described above.

As we already mentioned, the text replacement is case sensitive. If you want to redact a word no matter whether it’s capitalizated, you’ll need to create two separate text replacement rules.

One of these rules should replace the capitalized version, and another should replace the uncapitalized version, as you can see in the following image.

Case-sensitive text redaction

When you’re happy with the redaction rules you’ve created, click on the Save Changes button at the bottom of the screen.

The plugin will now scan your site and automatically replace any matches that it finds.

At some point you may no longer want to hide a particular word or phrase. In this case, you can simply delete the redaction rule. This will automatically remove the masking and show the original words across your WordPress blog.

To delete a redaction rule, simply go to Settings » Eyes Only.

Then, just hover the mouse over the rule that you want to delete and click on the ‘Delete’ link when it appears.

The automatic redaction settings

You will need to confirm that you want to delete the rule.

If you still want to go ahead, then click on ‘Yes.’

How to delete a text redact rule

Finally, it’s time to click the ‘Save Changes’ button at the bottom. Now if you visit any page or post that has the original word, you’ll see that the plugin is no longer redacting the text.

We hope this article helped you learn how to redact text in WordPress. You may also want to check out our ultimate WordPress security guide and the best live chat software.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Redact Text in WordPress (The Easy Way) first appeared on WPBeginner.

Comprehensive Guide to Java String Formatting

Formatting Strings in Java can be a confusing and difficult task for beginners and experts alike. While the concept of String formatting is simple, there are nearly endless combinations that can be easy to forget and frustrating to look up. In this article, we will outline the basic techniques for formatting Strings in Java using the venerable C-style and walk through easy-to-digest tables for all of the conversions and format specifiers available to us (that can be used as reference tables when we inevitably forget which format specifiers to use).

While not the focus of this article, we will also touch on the MessageFormat class and how it can provide a simplified approach when the C-style approach is too cumbersome. Additionally, we will look at the various mechanisms we can use to format C-style conversions, including flags, widths, and precisions. Lastly, we will cover some important references that will help us to gain a deeper understanding of formatting Strings in Java.

Formatting Tips and Tricks for Adobe Document Generation API

I’ve been having a fun time playing around with our Adobe Document Generation API service. It provides an easy-to-use API for generating PDFs and Microsoft Word docs based on a template and your data. Today, I will give you a deep dive into another topic — formatting.

When I talk about formatting, I’m talking about ways to display excellent information in your documents. Imagine for a moment the following text in your Microsoft Word document:

Python Code Formatters

If you write code that other developers review or contribute to, chances are you’re already adhering to a style guide for writing code. In this post, we look at the most popular code formatters in Python and help you decide on which one you should adopt.

The most popular code formatters in Python is:

Pain-Free JSON Formatting in Chrome

With the Super Bowl now over, surely your attention has now switched to how to view large amounts of unformatted JSON in an effective way.

Ok, maybe your attention hasn't been directed that way, but, ask yourself how many times as a web developer have you had to view a raw dump of an entire JSON document? I mean the kind that is tens of thousands of kilobytes large (or more!); most likely for debugging or tracking a setting down.

Using Minimum Fractional Digits With JDK 12 Compact Number Formatting

The post "Compact Number Formatting Comes to JDK 12" demonstrated the support added to NumberFormatin JDK 12 to support compact number formatting. The examples shown in that post only used the instances of NumberFormat returned by invocations of NumberFormat's new overloaded getCompactNumberInstance(-)methods, and so, therefore, they did not specify characteristics such as minimum fractional digits and maximum fractional digits. The results, in some cases, are less than desirable. Fortunately, NumberFormat does allow for minimum and maximum fractional digits to be specified, and this post demonstrates how that can improve the output of the compact number formatting available with JDK 12.

The code listing introduced in the original "Compact Number Formatting Comes to JDK 12" post (which is available on GitHub) has been updated to demonstrate the use of NumberFormat.setMinimumFractionDigits(int). An excerpt of that code is shown next and is followed by the accompanying output.