Inbound Links Same Cluster

The Inbound Links Same Cluster function finds other posts or pages within the same category or tag that contain links pointing to a specific post. This helps you gather a list of related posts linking back to your target post, which can be useful for SEO or analyzing content connections within a topic.

How It Works:

  • Identify Related Categories or Tags: First, it checks which categories or tags the target post belongs to, so it only looks for links from posts within the same topic

  • Retrieve Related Posts and Pages: The function then finds all posts or pages within the same category or tag that are published and checks if they contain links to the target post.

  • Look for Links and Shortcodes: For each related post, it scans the content to see if there’s a direct link or a specific shortcode that points to the target post. If a link or shortcode is found, it records the link text (the visible words in the link) and other details like the title of the post containing the link.

  • Store and Return Results: It saves the results for faster access next time and returns a list of related posts with links to the target post.

Specific Example:

Let’s say you have these posts and pages:

  • Post A: A guide on indoor plants, in the "Houseplants" category and tagged "Gardening."

  • Post B: Another post in "Houseplants" that has a link to Post A.

  • Page C: A page tagged "Gardening" that includes a shortcode linking to Post A.

When you run this function on Post A, it finds that Post B and Page C contain links pointing to it. The result might look like this:

[
    [
        'ID'          => 2,  // ID of Post B
        'title'       => 'Houseplant Tips',
        'type'        => 'post',
        'terms'       => 'Houseplants, Gardening',
        'anchor_text' => 'read more about indoor plants',
    ],
    [
        'ID'          => 3,  // ID of Page C
        'title'       => 'Gardening Advice',
        'type'        => 'page',
        'terms'       => 'Gardening',
        'anchor_text' => 'Shortcode Link',
    ],
]

Summary:

This function gathers a list of posts and pages within the same category or tag that contain links to a target post. This list helps you see what content is linking back to a specific post, allowing you to understand your internal link structure within a topic, which can benefit your SEO and user navigation.

Last updated