Appearance
Internal Links
Links in and out of every post, as Rank Math's Link Counter counts them; orphans.
kitloom/internal-links · admins: kitloom/internal-links-filament, kitloom/internal-links-nova
Rank Math's Link Counter on its own tables: every post's links, internal and external, and how many links of other posts lead to it. A site moved from WordPress keeps its counts, and Rank Math reads what this package writes.
The admin is kitloom/internal-links-filament or kitloom/internal-links-nova.
Where things are kept
| Table | A row |
|---|---|
rank_math_internal_links | one link: url as written, post_id it is in, target_post_id it leads to (0 — none), type internal or external |
rank_math_internal_meta | one post: internal_link_count, external_link_count, incoming_link_count |
How links are counted
As the plugin counted them on a WordPress site:
- every
<a href>, repeats too;#anchorsand links to files (images, documents, archives) are left out; - internal: relative addresses, the site's own host by
http,httpsor//, with or withoutwww., andtel:; external: other hosts,mailto:,javascript:; - a link leads to a post when its address opens a published post of a counted type; categories, drafts and missing pages lead nowhere;
- drafts are counted as well; trashed and deleted posts are not.
Where the plugin leaves rows stale, this package does not: links to a post that is gone or no longer published lead nowhere again, and links written before their target existed find it once it is published.
Counted types: every public post type the site declares but attachments, or the ones in kitloom-internal-links.post_types.
bash
php artisan internal-links:recount # every post again, as Rank Math's "Update Links"php
use Kitloom\InternalLinks\Models\LinkedPost;
LinkedPost::query()->find($id)->incomingLinks; // the links that lead to the postAI agents
With kitloom/ai installed, an agent whose user has view_internal_links reads the posts with their counts, the most linked-to first, or only the orphans — published posts nobody links to, the ones to link to when it writes (internal_links_report); the links themselves, of one post or to one post (internal_links_list); and counts every post again, as "Update Links" (internal_links_recount). kitloom-internal-links.ai.register false — no link report tools.
For other modules
Kitloom\InternalLinks\Events\LinksCounted is announced every time a post's links were counted again — the post and its rows as they are now. kitloom/link-checks listens to it to check the new addresses.