Linux 软件免费装
Banner图

Magic Linking – Internal Links

开发者 dcarrero
更新时间 2026年11月8日 23:14
PHP版本: 8.1 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

broken links internal links auto links orphan pages link suggestions

下载

0.9.2 0.10.0 0.11.0 0.20.0 0.21.1 0.23.0 0.23.1 0.22.1 0.24.0 0.21.0 1.0.0 1.0.1

详情介绍:

Magic Linking is a free internal linking plugin for WordPress. It gives you internal link suggestions while you write, in the block editor (Gutenberg) and in the classic editor, and adds the one you choose without touching anything else. Every change is kept in a history, so you can undo it. It also adds automatic internal links with rules you create ("this phrase links to this page"), and reports which of your posts and pages are orphans, under-linked, over-linked or have broken internal links. A free alternative to paid internal linking plugins: no account, no key and no limits, not even on the number of automatic rules. It works entirely on your server. Artificial intelligence is optional: it only runs if you have connected an AI provider in WordPress (Settings > Connectors) and press Improve with AI in the panel. In the editor Automatic rules How and when it changes your content History Report Also What it does not do (in this version) AI and your privacy Roadmap Next: suggestions by meaning with the AI connectors of WordPress, when WordPress offers embeddings.

安装:

  1. Install the plugin and activate it.
  2. Go to Magic Linking in the admin sidebar and press Analyze my site. Nothing is analysed until you do it. The first time it also builds the index used for suggestions, in the background.
  3. Open any post or page. In the block editor, open the Magic Linking panel from the top bar (or the three dots menu); in the classic editor, use the Magic Linking box.
  4. Read the suggestions and press Link on the ones you like.
  5. For the site-wide picture, use the filters Orphans, Under-linked, Over-linked and With broken links in the report, or open Broken links to change the destination of each one or remove it.
From the terminal: wp magic-linking index analyses the site and wp magic-linking report --filter=orphans --format=csv prints the orphan pages as CSV.

屏幕截图:

  • A link added with one click, with the Undo button on the card.
  • Inbound suggestions: other posts that could link to the one you are editing.
  • History: changes grouped by post, with date, filters, and undo and redo.
  • The report: totals for analyzed posts, orphans, internal links and broken links, with filters, search and sorting.
  • Settings in tabs (General, Suggestions, Links, AI, History and data) with a save bar that stays in view.

升级注意事项:

1.0.1 Security update: the report, the broken links list and the CSV export only show what the current user can read. Nothing in your content changes. 1.0.0 The complete free version: target phrases, excluding entries and categories, anchor warnings, a Status tab and more languages. After updating, two database indexes are created in the background; suggestions work meanwhile and nothing in your content changes. 0.24.0 Adds pillar content (also read from an active Yoast SEO or Rank Math) and filters by content type, category and tag for the suggestions. Filters are off by default; the update does not touch your content. 0.23.1 Only the readme changes: a shorter description so the plugin page shows it complete. 0.23.0 Adds automatic rules (Magic Linking > Rules) and lets you add links one by one from the report. Rules only add links, use the table of rules that already existed and are applied to existing entries only one at a time. The update does not touch your content. 0.22.1 The Link button now works in entries made of a single Classic block in the block editor. History now marks the links the AI recommended and can be exported to CSV. The update adds three columns to the history table by itself and does not touch your content. 0.21.1 Fixes "Improve with AI" with OpenRouter and other providers with many models: the chosen model is used exactly, cheaper models are recommended and the reason of a failure is shown. The update does not touch your content. 0.21.0 Adds an optional "Improve with AI" button that uses the AI connector of WordPress 7.0 or later, with a token estimate and a daily limit checked before anything is sent. Nothing changes if you have no connector. The update does not touch your content. 0.20.0 History now also records links added from the editor panel (two new columns in its table, updated automatically), and broken links can be fixed one by one. The update does not touch your content. 0.10.0 Adds link suggestions in the editor. After updating, the suggestions index is built in the background; it may take a few minutes on a big site. The plugin can now add links, always when you press Link and with Undo in History. The update does not touch your content. 0.9.2 Table schema rewritten without callable interpolation, package without development folders and clearer requirement checks on activation. No changes to your data. 0.9.1 Documentation fix only. No functional changes.

常见问题:

Does it change my posts or pages?

Only when you press Link on a suggestion or apply a rule, or when you publish or update a post that matches a rule you created. In every case it only adds a link.

  • Outbound suggestions (for the post you are editing): the link is inserted in the editor itself. You save the post when you want, as with any other change.
  • Inbound suggestions (links from other posts to this one): the link is written into the other post on the server. The rest of that post must stay identical, byte for byte, or nothing is written. WordPress creates a revision, and the change is listed in History, where you can undo it.
  • Automatic rules (the ones you create in Magic Linking > Rules) add their links in the background after you publish or update a post, with the same check and the same post in History.
  • It never modifies a post that is open in an editor, and it only edits, removes or rewrites a link you already had when you ask for it from the broken links list (change its destination or remove it, keeping its text), with the same check and undo.
Everything else (the report, the index, the settings, the broken links list until you fix one) only reads your content and writes to its own tables.

How do automatic rules work?

Go to Magic Linking > Rules, add a rule (a phrase, its variants and the post it should link to) and save it. From then on, when you publish or update a post whose text contains the phrase, the link is added in the background. To use a rule on posts you already have, press Apply to existing entries on the rule, review the sentence shown for each post and press Add link on the ones you want. You can create as many rules as you like. Rules never remove or change a link and respect your limits in Settings > Suggestions.

Can I apply a rule to all my posts at once?

No. In this version you add the links one post at a time, after seeing the sentence. Each one is recorded in History as "Automatic rule" and can be undone.

I undid a link that a rule added. Will it come back?

No. A rule does not add again a link you undid in that post. If you edit the rule (phrase, destination or options), it counts as a new rule and may add its link again.

Can I add links from the report without opening the post?

Yes. On each row of the report, Inbound suggestions and Outbound suggestions open a side panel with the same suggestions as the editor. Press Link on the ones you like; the numbers of the row update and you can undo each link there or from History. You need permission to edit that post.

How do I undo a link?

Right after adding it, press Undo on the card. Later, open Magic Linking > History and undo it there. You can also redo it. If the text around the link has been edited since, Magic Linking tells you instead of changing anything it cannot be sure about.

How do I leave a post or a category out?

For one post, press Exclude from the analysis on its row in the report. For whole categories, go to Settings > General and pick them under Categories left out. An excluded post is neither suggested nor used as a source of links; links that other posts already have to it still count. You can include it again at any time, and the report lists the excluded posts with the reason.

What are target phrases?

Phrases you write for a post (in the Target phrases section of the editor panel, up to 10, each with a few variants) to say "link to this post when the text says this". They are used by the suggestions like the post's own focus keyword, and they never add a link by themselves.

Can it detect the language of my posts?

Yes, if you turn on Detect the language of each entry from its text in Settings > General. It is off by default, does nothing while WPML or Polylang is active (they take priority) and, when it is not sure, uses the language of the site. It is checked on Spanish and English texts; other languages are not validated yet, so do not rely on it for them.

What is the Status tab?

The Status tab shows the time of the last 20 suggestion requests, split by phase, with the budget each should meet. It is a diagnostic: nothing is sent anywhere.

Where do I change the sensitivity of the suggestions?

In Settings > Suggestions > Show advanced settings: the key terms kept per post and the score threshold. The defaults are right for most sites; changing the number of terms rebuilds the index in the background.

How are links counted?

  • Only the links written inside the content of each post are counted. Links in menus, widgets, theme templates or blocks that are pulled from somewhere else are not, so your home page or a page that is only linked from the menu can appear as an orphan.
  • Content that a page builder keeps outside the normal post content is not read. If your builder saves rendered HTML in the post content, it is read.
  • Inbound = how many different posts link to this one, counting only links that work. Outbound = internal links to other pages; every appearance counts. Links to the same post, to files or to mailto: and tel: are not counted.
  • Category, tag, author, date and search pages, the home page and feeds are valid destinations and are never reported as broken.
  • Tracking parameters (utm_*, gclid, fbclid…) and anchors (#…) are ignored when matching a link to a post.

Does it need AI, an API key or an account?

No. It works entirely on your server, with no key, no account and no credit. AI is an optional extra: if you connect a provider in Settings > Connectors (WordPress 7.0 or later), the Improve with AI button appears. Magic Linking never asks for an API key of its own and does not sell credit; your provider charges you for what you use.

Does it send my content anywhere?

Not by itself. The only time text leaves your server is when you press Improve with AI, and then it goes to the AI provider you set up in Settings > Connectors, as described in "AI and your privacy" and "External services". With a local model such as Ollama it does not leave your server.

How much does Improve with AI cost?

The button shows an estimate before you press it and the real number of tokens afterwards. A request uses a few thousand tokens, which with a small model costs a fraction of a cent. You can set a daily token limit in Settings > AI. A local model costs nothing.

Why is there no AI button?

Because the site has no AI connector (add one in Settings > Connectors), WordPress is older than 7.0, the daily limit in Settings > AI is 0, or the site blocks AI requests.

Why does the panel say there are no suggestions?

The suggestions come from the index of your site, which is built in the background after you press Analyze my site. Until it is ready the panel says so. Also, suggestions need text: a very short post has little to suggest, and posts in another language, drafts, private posts and password-protected ones are never proposed as destinations.

Can I favour my main pages, or only link within a category?

Yes. Tick Pillar content in the panel (while Yoast SEO or Rank Math are active, their cornerstone or pillar mark also counts, without asking you anything): links to those posts rank a little higher. In Settings → Suggestions you can ignore, take into account or require the content type, category and tag. These are quality settings, never limits.

Why can't I link from this phrase?

Links are only inserted in paragraphs and lists, and never inside an existing link. Headings, quotes and tables are off by default: turn them on in Magic Linking > Settings > Links > Where links can be inserted. A developer can allow more block types with magiclinking_insertable_blocks.

Does it work in the classic editor?

Yes, with a Magic Linking box. Links are inserted in the Visual tab; in Text the box explains how to switch.

Why does my home page (or another page) appear as an orphan?

Because it is not linked from the content of any other post. If it is linked from your menu, the menu is not counted. See "How links are counted".

Why is a link not listed as broken if the page is really gone?

A link is reported when it points to a post in the trash, unpublished or private, or to an address of your site that WordPress does not recognise. If a redirect plugin sends the old address elsewhere, the link may still work for your visitors. Developers can tell Magic Linking about redirects with the magiclinking_resolve_link filter.

Does it work with WPML or Polylang?

Yes. It records the language of every post, never suggests a link between two languages and, when WPML or Polylang is active (or the analysis finds more than one language), shows it in the report, lets you filter by it and adds it to the CSV. On a single-language site those columns are hidden.

How long does the first analysis take?

A few seconds for a small site; thousands of posts per minute on ordinary hosting. It runs in the background; you can keep working and watch the progress on the screen.

The analysis does not move.

It needs Action Scheduler to run, which WordPress triggers with WP-Cron. On sites with very little traffic, use a system cron, or run wp action-scheduler run --group=magic-linking, or analyse directly from the terminal with wp magic-linking index.

How do I analyze only what changed?

Press "Analyze changes" in the report (or run wp magic-linking index). It goes through every post but skips the ones whose content has not changed since the last analysis, and tells you how many were new or modified. Posts are also analysed again automatically when you save them.

How do I analyze the whole site again from scratch?

Go to Magic Linking > Settings, open the General tab, find the "Maintenance" section and press "Analyze everything again from scratch" (or run wp magic-linking index --force). It asks you to confirm and then runs in the background, even for posts that have not changed. It never changes your content.

What happens when I delete the plugin?

By default your data is kept. If you tick "Delete all Magic Linking data when the plugin is deleted" in the settings, its tables (index, links, history), processes, settings and metadata are removed. The links already written in your content stay where they are; your content is never touched.

Is it multisite compatible?

Each site of a network has its own report, history and settings.

Which hooks can developers use?

  • magiclinking_link_inserted: action that runs after a link has been inserted from the server.
  • magiclinking_batch_undone: action that runs after a group of links has been undone.
  • magiclinking_link_fixed: action that runs after a broken link has been fixed (destination changed or link removed), or that fix has been redone.
  • magiclinking_insertable_blocks: filter for the block types where links can be inserted.
  • magiclinking_post_lock_timeout: filter for the seconds to wait when another insertion or undo is writing the same post.
  • magiclinking_undo_sync_limit: filter for how many changes are undone at once before the rest goes to the background.
  • magiclinking_post_language: set the language of a post.
  • magiclinking_internal_hosts: extra hosts that count as your site.
  • magiclinking_resolve_link: say where an internal address leads.
  • magiclinking_post_html: add HTML that a builder keeps outside the content.
  • magiclinking_before_ai_request: filter to veto or change a request to the AI connector before it is sent (return false to veto). The WordPress filter wp_ai_client_prevent_prompt is respected too.
  • magiclinking_local_ai_providers: filter for the AI providers that count as local (the text does not leave your server).
  • magiclinking_is_multilingual: tell the plugin whether the site is multilingual.
  • magiclinking_batch_max_entries and magiclinking_batch_time_budget: size and time of each background batch.

更新日志:

1.0.1 1.0.0 0.24.0 0.23.1 0.23.0 0.22.1 0.21.1 0.21.0 0.20.0 0.11.0 0.10.0 0.9.2 0.9.1 0.9.0