|
/ Documentation /Developers Documentation/ Customize Blocked Link Statuses surerank_link_manager_blocked_statuses

Customize Blocked Link Statuses surerank_link_manager_blocked_statuses

Hook: surerank_link_manager_blocked_statuses

Description: The surerank_link_manager_blocked_statuses filter controls which status codes the SureRank Link Manager shows as Blocked for external links. Some websites refuse automated checks, even though their pages open normally in a browser. Link Manager shows these links as Blocked instead of broken, so they are not counted in Broken Links. By default, the status codes 401, 403 and 429 are treated as blocked.

Source: inc/database/tables/link-manager.php

Usage: Use this filter to add more status codes to the blocked list, remove some, or turn the Blocked status off so every error code counts as broken. The filter receives one value: $statuses, a list of status codes (default [ 401, 403, 429 ]).

Note:

This filter requires SureRank Pro. Upgrade here.

Example: Also Treat 503 as Blocked

If you’re looking to stop external links that return 503 (often a bot-protection page) from being counted as broken, add the code below.

add_filter( 'surerank_link_manager_blocked_statuses', 'custom_blocked_statuses' );

function custom_blocked_statuses( $statuses ) {
    $statuses[] = 503;
    return $statuses;
}

Example: Count Every Error as Broken

If you’re looking to turn off the Blocked status, so that every external link with an error code (400 or higher) counts as broken, add the code below.

add_filter( 'surerank_link_manager_blocked_statuses', '__return_empty_array' );

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Expected Outcome

In your WordPress dashboard, go to SureRank → Link Manager → Dashboard. External links with a blocked status are not counted in the Broken Links card. In the example below, the site has 4 external links: two return a blocked status (403 and 429), one returns 404, and one works. Only the 404 link counts as broken.

To see each link’s status, open a page’s links report, for example from Top Linked Pages. In the Status column, links with a blocked status show a grey badge such as 403 Blocked. Hover over the badge to see the message “This site blocks automated checks. The link may still work in a browser.”

Notes

  • The Blocked status applies to external links only. Internal links with these codes are still counted as broken, because they point to your own site.
  • Changes from this filter show right away. You don’t need to scan your links again, because SureRank checks the list each time it shows the results.
  • Only whole numbers are used. Other values in the list are ignored.

Related Docs

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top