Hi,
Please try this in Yoast SEO Plugin’s file wordpress-seo\admin\links\class-link-column-count.php in function name get_results().
Please change the following query.
Before Changing query:
$results = $wpdb->get_results(
$wpdb->prepare( ‘
SELECT internal_link_count, incoming_link_count, object_id
FROM ‘ . $storage->get_table_name() . ‘
WHERE object_id IN ( %1$s )’,
implode( ‘,’, $post_ids )
),
ARRAY_A
);
After Changing query:
$imploded_post_ids = implode( ‘,’, $post_ids );
$results = $wpdb->get_results(
‘SELECT internal_link_count, incoming_link_count, object_id
FROM ‘ . $storage->get_table_name() . ‘
WHERE object_id IN ( ‘.$imploded_post_ids.’)’,ARRAY_A
);
and check.
This solved my problem.
Thanks
You removed wpdb->prepare which is unsafe. With “prepare” you set the query to be safely executed. I’m not going to use this method and neither should you.
Hi,
You can also try this in File wordpress-seo\admin\links\class-link-column-count.php in function name get_results().
$no_strings = count($post_ids);
$ids_placeholders = array_fill(0, $no_strings, “%d”);
$format = implode(‘, ‘, $ids_placeholders);
$results = $wpdb->get_results(
$wpdb->prepare
(
‘SELECT internal_link_count, incoming_link_count, object_id
FROM ‘ . $storage->get_table_name() . ‘
WHERE object_id IN (‘.$format.’)’,
$post_ids
),ARRAY_A
);
This too solved your problem.
Thanks
Hello,
This issue has been fixed in the latest release of the Yoast plugin. Please update to Yoast SEO 5.4.1.
Thanks!