Hi @moovio
Please try adding following code to the site as a Must Use plugin:
<?php
add_action( 'admin_init', 'wpmudev_blc_export_all_links' );
function wpmudev_blc_export_all_links() {
if ( ! isset( $_GET['page'] ) ) {
return;
}
if ( $_GET['page'] != 'blc_local' ) {
return;
}
if ( ! isset( $_GET['blc_export_links'] ) ) {
return;
}
$links = blc_get_links(
array(
'load_instances' => true,
'load_containers' => true,
'max_results' => 0,
)
);
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="blc-links.csv";');
// open the "output" stream
// see https://www.php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-descriptioq
$f = fopen('php://output', 'w');
foreach ( $links as $link ) {
fputcsv( $f, array( $link->url ), ';' );
}
fclose( $f );
exit();
}
To do that simply:
– create an empty file with a .php extension (e.g. blc-expor-csv.php) in the “/wp-content/mu-plugins” folder of your site’s WordPress install
– paste code into it and save the file.
Then you would want to visit Broken Link Checker page on your site with an additional parameter added to URL like this:
yoursite.com/wp-admin/admin.php?page=blc_local&filter_id=all&blc_export-links=true
Best regards,
Adam