Automatic Links icon

Automatic Links

Automatic Links

Description

Automatic Links is a PHP class that allows you to automatically apply links on a HTML document.

This class is already in use in other products from our portfolio. In particular, it’s adopted to apply the automatic links in WordPress plugins with thousands of users, like Interlinks Manager.

How the class applies the automatic links

This class uses PHP regular expressions to generate the links from a list of keywords and URLs provided by the user.

It’s worth noting that this class gives you total control over the algorithm used to apply the links. Specifically, you can configure a high number of options both at the class level and at the automatic link level to:

  • Limit the maximum number of automatic links to a specific number
  • Select between a case sensitive or a case insensitive search of the keyword
  • Add the Nofollow attribute on the link element
  • Set a custom title attribute on the link element
  • Open the links in the same tab or a new tab
  • Find only the occurrences of the keyword preceded or followed by a specific string
  • Configure specific word boundaries based on the particular context or language
  • Prioritize individual keywords over the others

We have also included other advanced features for the most demanding users. For example, you can:

  • Prevent the application of the automatic link on specific HTML elements
  • Improve the distribution of the automatic links with the “Random Prioritization” feature
  • Prevent the application of the automatic links that target the current URL
  • Limit the maximum number of automatic links based on the length of the provided string
  • Limit the maximum number of automatic links that target the same URL

How to use the class

The simplest usage example of this automatic links class:

require_once( 'inc/class-daext-automatic-links.php' );
$automatic_links = new DaextAutomaticLinks();

echo $automatic_links->add_autolinks( '<p>Buy my book.</p>',
    [
        [
            'keyword' => "book",
            'url'     => " 
        ]
    ]
);

The above example will output:

<p>Buy my <a href=">book</a>.</p>

This other script uses advanced options to:

  • Open the generate links on a new tab
  • Limit the number of automatic links to two
  • Protect specific tags
require_once( 'inc/class-daext-automatic-links.php' );
$automatic_links = new DaextAutomaticLinks();

$automatic_links->set_options(
    [
        'open_new_tab'         => true,
        'general_limit_amount' => 2,
        'protected_tags'       => [
            'h1',
            'h2',
            'h3',
            'h4',
            'h5',
            'h6',
            'strong',
            'pre',
            'code'
        ]
    ]
);

$article = '<h2>iPhone 14 range</h2>';
$article .= '<p>The iPhone 14 is an obvious pick on our list.</p>';

echo $automatic_links->add_autolinks( $article,
    [
        [
            'keyword' => "iPhone 14",
            'url'     => " 
        ]
    ]
);

The above example will output:

<h2>iPhone 14 range</h2><p>The <a target="_blank" href=">iPhone 14</a> is an obvious pick on our list.</p>

Note that more examples are available in the class demo and the plugin manual.

Updates

15.03.2022 - v1.05
  - Improved documentation
14.03.2022 - v1.03
  - First release

Do you care about your website’s SEO?

Improve your internal links structure and get more visits on your WordPress website with the Interlinks Manager plugin.

External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.

Products of the Week.

Submit
codester.com

codester.com

SocialDesk+: Omnichannel Social Commerce & Business Management Platform This is stronger than simply “Social Commerce and Messaging” because it tells buyers this is a complete business platform, not just a messaging script. Turn Social Conversations Into Sales SocialDesk+ is a complete omnichannel social commerce and business management platform built for businesses that sell and communicate with customers through social media. Instead of switching between WhatsApp, Facebook, Instagram and TikTok, businesses can manage customer conversations, comments, products, leads, follow-ups, automation, teams and business reports from one professional workspace. And because the full source code is included, developers, agencies and entrepreneurs can customize, rebrand and launch SocialDesk+ as their own business solution or SaaS platform. 🚀 Build Your Own Social Commerce Business SocialDesk+ gives you the foundation to launch: - Your own SaaS platform - A white-label social CRM - A social-commerce management system - A customer communication platform - A business messaging solution - A custom solution for clients - A multi-business subscription platform 💬 Connect Your Customers Supported social channels include: WhatsApp • Facebook • Instagram • TikTok Bring supported conversations into one centralized workspace and help businesses respond faster without constantly switching between platforms. 🛍️ More Than a Messaging Platform SocialDesk+ combines communication with the tools businesses need to manage customer opportunities: Inbox Manage customer conversations from connected channels. Comments Monitor and respond to social-media comments. Customers & Leads Organize customer information and potential buyers. Products & Catalog Manage products and give your team quick access to product information. Follow-Ups Make sure potential customers don't get forgotten. Automation Automate repetitive customer questions and responses. AI Assistant Provide AI-assisted communication when configured. Team Management Give managers and staff access to the business workspace. Reports & Analytics Track activity using business reports and analytics. The current product listing already includes these capabilities. 🔥 Why Buyers Will Want It Launch Faster Start with an already-built business platform instead of developing the entire system from zero. Customize Everything The full source code is included, allowing developers to change branding, features, workflows and integrations. Build a SaaS Create multiple business workspaces and offer SocialDesk+ as a subscription-based service. Sell to Businesses Offer it to retailers, restaurants, service businesses, online sellers, agencies and other businesses that communicate with customers through social media. Mobile + Web + Backend This isn't just a mobile UI template. It includes: - Flutter mobile application - Python / FastAPI backend - Web interface - Administration tools - Database infrastructure - API-based architecture - SQLite / PostgreSQL support - Android and iOS project structure 💼 One Platform. Multiple Business Opportunities. For SaaS Entrepreneurs Launch your own subscription platform and allow multiple businesses to operate inside separate workspaces. For Software Agencies Customize and rebrand the platform for clients instead of building an omnichannel business system from scratch. For Developers Use the complete source code as a foundation for your own social-commerce or customer-management product. For Businesses Deploy a dedicated version for your own customer-service and social-commerce operations. 🧩 What's Included Mobile - Flutter / Dart - Android - iOS project Backend - Python - FastAPI - SQLAlchemy - Alembic Database - SQLite - PostgreSQL Web - HTML5 - CSS3 - JavaScript Deployment - Docker - Docker Compose - Production configuration Business Platform - Multi-workspace architecture - Authentication - Teams - Customers - Products - Messaging - Comments - Automation - Reports - Subscriptions - Administration The current listing also documents third-party integrations such as Meta, TikTok, Stripe, Firebase, SMTP and optional OpenAI configuration. ⚡ What Makes SocialDesk+ Different? You're not buying a simple: ❌ Chat UI ❌ WhatsApp clone ❌ Flutter template ❌ Admin dashboard ❌ Basic CRM You're getting a complete business platform foundation that can be customized, branded and commercialized. Connect. Automate. Manage. Grow. SocialDesk+ Omnichannel Social Commerce & Business Management Platform One important change I'd make to the current listing The current page starts with: “A simple guide to managing your social conversations, customers, products and business activity.”

Other · 3,604 views · 31 clicks

$2

Automatic Links | Code Market