WordPress plugin intelligence profile

Text Replace

Replace text with other text. Handy for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.7
Current version4.0
WordPress coverageTested up to WordPress 5.7
Minimum stackWP 4.9 · PHP —
Directory statusactive
Last directory update12 Jul 20215y ago
Active installations3K+Adoption metric — not a quality score
WordPress.org rating4.4 / 5 from 18 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Text Replace version 4.0 as active, updated 5y ago and tested up to WordPress 5.7.

Overview

About this plugin

This plugin allows you to easily define text or HTML that should be used in your posts in place of words or phrases that are actually present in the posts. This is a handy technique for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies.

Additional features of the plugin controlled both via settings and filters:

  • Text replacement can be enabled for comments (it isn’t by default)
  • Text replacement can be made case insensitive (it is case sensitive by default)
  • Text replacement can be limited to doing only one replacement per term, per post (by default, all occurrences of a term are replaced)
  • Text replacement can be handled early or late in WordPress’s text filtering process (it’s early by default)
  • Text replacement can be expanded to affect other filters

A few things to keep these things in mind:

-

Your best bet with defining shortcuts is to define something that would never otherwise appear in your text. For instance, bookend the shortcut with colons:

:wp: => WordPress

:aol: => America Online, Inc.

Otherwise, you risk proper but undesired replacements:

Hi => Hello

Would have the effect of changing “His majesty” to “Hellos majesty”.

-

If you intend to use this plugin to handle smilies, you should probably disable WordPress’s default smilie handler on the Writing Settings admin page.

-

This plugin is set to filter ‘the_content’, ‘the_excerpt’, ‘widget_text’, and optionally, ‘get_comment_text’ and ‘get_comment_excerpt’. Filters from popular plugins such as Advanced Custom Fields (ACF) and Elementor are also handled by default (see FAQ for specifics). The “More filters” setting can be used to specify additional filters that should be handled by the plugin.

The filter ‘c2c_text_replace_filters’ can also be used to add or modify the list of filters affected.

-

Text inside of HTML tags (such as tag names and attributes) will not be matched. So, for example, you can’t expect the:mycss: shortcut to work in <a href="" style=":mycss:">text</a>

-

SPECIAL CONSIDERATION: Be aware that the shortcut text that you use in your posts will be stored that way in the database. While calls to display the posts will see the filtered, text-replaced version, anything that operates directly on the database will not see the expanded replacement text. com'>America Online</a> ), visitors to your site will see the linked, expanded text due to the text replace, but a database search would never turn up a match for “America Online”.

-

However, a benefit of the replacement text not being saved to the database and instead evaluated when the data is being loaded into a web page is that if the replacement text is modified, all pages making use of the shortcut will henceforth use the updated replacement text.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Developer Documentation

md. That documentation covers the numerous hooks provided by the plugin. Those hooks are listed below to provide an overview of what’s available.

  • c2c_text_replace_filters: Customize what hooks get text replacement applied to them.
  • c2c_text_replace_third_party_filters: Customize what third-party hooks get text replacement applied to them.
  • c2c_text_replace_filter_priority: Override the default priority for the ‘c2c_text_replace’ filter.
  • c2c_text_replace Customize or override the setting defining all of the text replacement shortcuts and their replacements.
  • c2c_text_replace_comments: Customize or override the setting indicating if text replacement should be enabled in comments.
  • c2c_text_replace_case_sensitive: Customize or override the setting indicating if text replacement should be case sensitive.
  • c2c_text_replace_once: Customize or override the setting indicating if text replacement should be limited to once per term per piece of text being processed regardless of how many times the term appears.
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • coffee2code
  • replace
  • shortcut
  • substitution
  • text
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.7

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.7.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.7
Minimum requirementsWordPress 4.9 · PHP not listed
Update activity12 Jul 20215y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.