Hello,
You can use the below query to select the Post IDs that does not have incoming links:
SELECT t1.ID FROM wp_posts t1
LEFT JOIN wp_rank_math_internal_links t2 ON t2.target_post_id = t1.ID
WHERE t2.target_post_id IS NULL;
Please replace wp_
with the prefix of the table on your database.
Let us know how that goes.
Thank you.
Puting this query is giving me more than 5000+ rows where as i have only <1000 post
Hello,
As you didn’t mention any post type in your initial message, the query I shared previously listed the IDs of all the post types which did not have any incoming links.
If you only want to see the IDs of posts, then you can use the below query:
SELECT t1.ID FROM wp_posts t1
LEFT JOIN wp_rank_math_internal_links t2 ON t2.target_post_id = t1.ID
WHERE t2.target_post_id IS NULL AND t1.post_type='post' AND t1.post_status='publish';
This would give the IDs of posts that are published and do not have any incoming links.
Let us know how that goes.
Thank you.
Hello,
That filter is available in the PRO version of Rank Math.
If you wish, you can purchase the PRO subscription and get access to advanced filtering options along with many advanced features: https://rankmath.com/pricing/
You can check a full comparison here:
https://rankmath.com/free-vs-pro/
Hope this helps.
Thank you.