=== Simon's Auto Keyword Linker ===
Contributors: si000777
Donate link: https://simonward.net/support-my-plugin-development/
Tags: internal linking, automatic linking, seo, keyword linking, keyword scanner
Requires at least: 5.6
Tested up to: 6.9
Stable tag: 1.8.8
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically scans and converts keywords into links — internal links stay dofollow, external links can optionally open in a new tab with nofollow.

== Description ==

**Simon’s Auto Keyword Linker** is a lightweight, fast, and intelligent WordPress plugin that automatically transforms your selected keywords into links across posts and pages.

Perfect for internal linking, topic clusters, dictionaries/glossaries, affiliate linking, and improving SEO at scale — all without bloat.

### 🚀 Key Features

- Unlimited keyword → URL pairs
- Link each keyword up to **1–50 times per post/page**
- **Never links a keyword on its own target page** (prevents self-linking)
- Case-insensitive, whole-word matching
- Skips headings (H1–H6), existing links, and all HTML tags
- Sorts keywords by length to prevent overlapping/partial matches
- Clean, efficient engine based on safe regex & placeholders
- Works with Gutenberg, Classic Editor, page builders, and most themes
- Fully compatible with caching plugins

### 🔍 Smart Keyword Scanner (New!)

Click one button and the plugin will:

- Scan **all published posts and pages**
- Detect highly-relevant multi-word phrases already appearing on your site
- Score and rank them based on frequency + title relevance
- Suggest the **best internal page** to link each phrase to
- Allow one-click add or delete ("Trash") suggestions

No more guessing what to link — get data-driven internal linking recommendations instantly.

### 🔗 External Link Control

For external URLs, you can enable:

- `target="_blank"`
- `rel="nofollow noopener noreferrer"`

Internal links remain dofollow for optimal SEO.

### 🤖 How the Linking Engine Works

- Matches whole words only — never inside other words or URLs  
- Never links inside headings (`<h1>`–`<h6>`)
- Ensures links are not placed inside existing `<a>` tags
- Automatically decodes HTML entities like `&amp;` → `&`
- Prevents short-keyword conflicts by linking **longest phrases first**

### Example keyword rules:

Web Hosting|https://yourwebsite.com/web-hosting/

Contact Form|https://yourwebsite.com/contact/

External URL|https://example.com


== Installation ==

1. Upload the `simons-auto-keyword-linker` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Settings → Keyword Links**
4. Add your `keyword|URL` pairs (one per line)
5. Optional:  
   - Set max links per keyword  
   - Enable new-tab + nofollow for external links  
   - Use the built-in **Smart Keyword Scanner** to auto-discover new keyword opportunities

== Frequently Asked Questions ==

= Does this plugin modify my database content? =
No. Links are added dynamically when pages are displayed. Disable the plugin and everything returns to normal.

= Will this slow down my site? =
No. The plugin is extremely lightweight and runs only on the `the_content` filter using efficient regex logic.

= Does it work with page builders? =
Yes — it works with Gutenberg, Classic Editor, Elementor, Divi, WPBakery, Bricks, and most other builders (as long as the builder uses `the_content` output).

= Can it link multi-word phrases? =
Yes — and phrases are sorted by length so longer keywords are linked first.

= Does it prevent over-linking? =
Yes — you control the maximum number of links per keyword per page.

== Upgrade to Pro (Optional) ==

**Auto SEO Keyword Linker Pro** adds advanced features such as:

- Conditional logic per keyword (e.g., `category:5`, `post-type:page`)
- Click statistics per link
- Export & Import your keyword rules
- Link title attribute control
- Max links per page & advanced targeting

Learn more (optional upgrade):  
https://simonward.net/auto-seo-keyword-linker/


== Changelog ==

= 1.8.8 =
* Improved: Cleaner, more intuitive UI for the Smart Keyword Scanner
* Added: Bulk delete ("Trash Selected") option in keyword suggestions
* Added: Option to select maximum words per keyword phrase when scanning
* Added: Option to set minimum occurrences (1–5) to reduce low-quality or accidental keyword phrases
* Improved: More accurate keyword and phrase scanning
* Improved: Better filtering of repeated or low-value phrases
* Improved: More reliable handling of punctuation and special characters in scanned phrases
* Improved: Reduced duplicate suggestions and overall scan quality

= 1.8.7 =
* Added: Smart Keyword Scanner — auto-discover valuable phrases from your content
* Added: One-click suggestion of best internal link targets
* Added: Select-all and bulk-add functionality in keyword generator
* Improved: Better UI/UX in settings

= 1.8.6 =
* Added: Option to open external links in new tab with rel="nofollow noopener noreferrer"
* Added: Visual indicator (Internal / External) in settings table
* Improved: Better escaping and WordPress coding standards compliance
* Fixed: All known bugs and layout issues

= 1.7.0 =
* First public release.