Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics

How to Use the Internal Link Count Filter

Hey guys,

I replied to a previous topic about this, but it was already marked as solved, so I’m guessing you didn’t see it. Here it is again:

I saw you guys added a filter for explicitly naming internal domains in your latest release, 4.1. I really appreciate it.

Would you mind providing a brief example of how I would go about using it? (I’m still very much a beginner with PHP)

My main website is I host my images on, and when I link to them, can I exclude them from the link count? If not, can you show me how I would count these as internal and not external links?

Also, I cloak quite a few affiliate links: Is there any way to count any link starting with as an external link?

Thanks for your help!

3 years, 8 months ago

Hi Dave,

Sorry, I indeed did not see your reply on the ‘marked as solved’ issue before. As you already found out we introduced the ac/column/linkcount/domains filter. This filter allows you to say which domains are marked as ‘internal’. By default this function return an array which contains only the current domain of your website.

So in your case, you should add the ‘’ domain to the array by using the following snippet.

 * @param array $domains
 * @return array
function acp_add_internal_domains( $domains ) {
	$domains[] = '';

	return $domains;

add_filter( 'ac/column/linkcount/domains', 'acp_add_internal_domains' );

Please notice that this filter only allows you to add domains that are marked as internal. So it is not possible to count any links started with an internal domain count as an external link. So you really have to write your own column if you want to do that kind of logic since I don’t think this is the kind of behavior our link count column should support. Please let me know if you have any other question related to this filter.


3 years, 8 months ago

Thanks Stefan. I spot checked a few posts, and this appears to be working perfectly.

3 years, 8 months ago

Cool, thanks for the feedback!

3 years, 8 months ago

You must be logged in to reply to this topic.