Linkify Text

Linkify Text

Wordpress plugin

Install on Wordpress

App Details

This plugin allows you to define words or phrases that, whenever they appear in your posts or pages, get automatically linked to the URLs of your choosing. For instance, wherever you may mention the word “WordPress”, that can get automatically linked as “WordPress“.

Additional features of the plugin controlled via settings and filters:

  • Text linkification can be enabled for comments (it isn’t by default)
  • Text linkification can be made case sensitive (it isn’t by default)
  • Text linkification can be limited to doing only one linkification per term, per post (by default, all occurrences of a term are linkified)
  • Text linkification links can be set to open in a new window (it isn’t by default)

You can also link multiple terms to the same link and only define that link once in the settings via use of a special link syntax.

A number of filters exist to programmatically customize the behavior of the plugin, all of which are documented.

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

Hooks

The plugin exposes a number of filters for hooking. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). Bear in mind that most of the features controlled by these filters are configurable via the plugin’s settings page. These filters are likely only of interest to advanced users able to code.

c2c_linkify_text_filters (filter)

The ‘c2c_linkify_text_filters’ hook allows you to customize what hooks get text linkification applied to them.

Arguments:

  • $hooks (array): Array of hooks that will be text linkified.

Example:

/** * Enables text linkification for custom fields. * * @param array $filters The filters handled by the Linkify Text plugin. */ function more_text_replacements( $filters ) { $filters[] = 'the_meta'; // Here you could put in the name of any filter you want return $filters; } add_filter( 'c2c_linkify_text_filters', 'more_text_replacements' ); 

c2c_linkify_text_comments (filter)

The ‘c2c_linkify_text_comments’ hook allows you to customize or override the setting indicating if text linkification should be enabled in comments.

Arguments:

  • $state (bool): Either true or false indicating if text linkification is enabled for comments. The default value will be the value set via the plugin’s settings page.

Example:

// Prevent text linkification from ever being enabled in comments. add_filter( 'c2c_linkify_text_comments', '__return_false' ); 

c2c_linkify_text (filter)

The ‘c2c_linkify_text’ hook allows you to customize or override the setting defining all of the text phrases and their associated links.

Arguments:

  • $linkify_text_array (array): Array of text and their associated links. The default value will be the value set via the plugin’s settings page.

Example:

/** * Programmatically adds more text to be linked. * * @param array $text_to_links Array of text and their associated URLs. */ function my_text_linkifications( $text_to_links ) { // Add text link $text_to_links['Matt Mullenweg'] => 'https://ma.tt'; // Unset a text link that we never want defined if ( isset( $text_to_links['WordPress'] ) ) { unset( $text_to_links['WordPress'] ); } // Important! Return the changes. return $text_to_links; } add_filter( 'c2c_linkify_text', 'my_text_linkifications' ); 

c2c_linkify_text_case_sensitive (filter)

The ‘c2c_linkify_text_case_sensitive’ hook allows you to customize or override the setting indicating if text matching for potential text linkification should be case sensitive or not.

Arguments:

  • $state (bool): Either true or false indicating if text matching is case sensitive. The default value will be the value set via the plugin’s settings page.

Example:

// Prevent text matching from ever being case sensitive. add_filter( 'c2c_linkify_text_case_sensitive', '__return_false' ); 

c2c_linkify_text_replace_once (filter)

The ‘c2c_linkify_text_replace_once’ hook allows you to customize or override the setting indicating if text linkification should be limited to once per term per piece of text being processed regardless of how many times the term appears.

Arguments:

  • $state (bool): Either true or false indicating if text linkification is to only occur once per term. The default value will be the value set via the plugin’s settings page.

Example:

// Only linkify a term once per post. add_filter( 'c2c_linkify_text_replace_once', '__return_true' ); 

c2c_linkify_text_open_new_window (filter)

The ‘c2c_linkify_text_open_new_window’ hook allows you to customize or override the setting indicating if links should open in a new window.

Arguments:

  • $state (bool): Either true or false indicating if links should open in a new window. The default value will be the value set via the plugin’s settings page, which itself is defaulted to false.

Example:

// Make links open in a new window. add_filter( 'c2c_linkify_text_open_new_window', '__return_true' ); 

c2c_linkify_text_linked_text (filter)

The ‘c2c_linkify_text_linked_text’ hook allows you to customize or override the replacement link markup for a given string. Return the value of $old_text to effectively prevent the given text linkification.

Arguments:

  • $new_text (string): The link markup that will replace $old_text.
  • $old_text (string): The text being replaced/linkified.
  • $link (string): The URL that $old_text is to be linked to.
  • $text_to_link (array): The full array of text and the URLs they should link to.

Example:

/** * Disable linkification of links for posts that have the 'disable_linkify_text' * custom field defined. * * @param array $display_link The associative array of attributes to be used for the link. * @param string $old_text The text being replaced/linkified. * @param string $link_for_text The URL that $old_text is to be linked to. * @param string $text_to_link The full array of text and the URLs they should link to. * @return string */ function selectively_disable_text_linkification( $display_link, $old_text, $link_for_text, $text_to_link ) { if ( get_metadata( 'post', get_the_ID(), 'disable_linkify_text', true ) ) { $display_link = $old_text; } return $display_link; } add_filter( 'c2c_linkify_text_linked_text', 'selectively_disable_text_linkification', 10, 4 ); 

c2c_linkify_text_link_attrs (filter)

The ‘c2c_linkify_text_link_attrs’ hook allows you to add or customize attributes for the link.

Arguments:

  • $attrs (array): The associative array of attributes to be used for the link. By default includes ‘href’.
  • $old_text (string): The text being replaced/linkified.
  • $link (string): The URL that $old_text is to be linked to.

Example:

/** * Force links created by Linkify Text plugin to open in a new tab. * * @param array $attrs The associative array of attributes to be used for the link. * @param string $old_text The text being replaced/linkified. * @param string $link The URL that $old_text is to be linked to. * @return array */ function my_linkify_text_attrs( $attrs, $old_text, $link ) { $attrs['target'] = '_blank'; return $attrs; } add_filter( 'c2c_linkify_text_link_attrs', 'my_linkify_text_attrs', 10, 3 ); 

Pricing

Starting from $0 per month.

Check Out the Info List Widget

By Common Ninja

Info ListTry For Free!

App Info

Rating

Reviewers

14 reviews

Tags

autolink
hyperlink
link
replace
text

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Info List for Wordpress logo

Info List

An Info List presents key details in a clear, structured format to improve user experience and support conversions.

Lottie Player for Wordpress logo

Lottie Player

Use a Lottie player to embed lightweight JSON animations that improve visual design, keep pages fast, and create a smoother user experience.

Stories for Wordpress logo

Stories

Add interactive stories to your site to showcase content in a visual, mobile-friendly format that boosts engagement and guides visitors toward action.

Mega Footer for Wordpress logo

Mega Footer

Create a mega footer that organizes navigation links, contact info, logos, social icons and improves usability and site structure.

Catalog for Wordpress logo

Catalog

Create and customize product catalogs with a catalog widget that organizes items clearly, improves browsing, and helps visitors explore your offerings easily.

Restaurant Menu List for Wordpress logo

Restaurant Menu List

Create a clear restaurant menu list that helps visitors explore dishes easily, understand key details, and make confident ordering decisions that support conversions.

WhatsApp Chat for Wordpress logo

WhatsApp Chat

Add WhatsApp Chat to your site to communicate with visitors, deliver instant support, and create a smoother, more trustworthy user experience.

Size Chart for Wordpress logo

Size Chart

Add a flexible size chart with visual guides and category tabs to help users choose accurate measurements while shopping.

Comments for Wordpress logo

Comments

Add a comments system with replies, voting, and moderation to boost engagement and build an active community on your site.

LinkedIn Feed Slider for Wordpress logo

LinkedIn Feed Slider

Show LinkedIn posts with a slider that auto updates, presents content in a smooth layout, and keeps visitors engaged.

Feedback Form for Wordpress logo

Feedback Form

Collect user insights with a feedback form that gathers valuable input, improves user experience, and helps you understand visitor needs more clearly.

Corner Pop-up for Wordpress logo

Corner Pop-up

Add a floating corner pop-up to display updates or calls to action without disrupting the user experience or site flow.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms