-
-
Save mkormendy/ff54af5407ea67a48d2337fe8db9410b to your computer and use it in GitHub Desktop.
Export Yoast redirects to CSV file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array_base = get_option('wpseo-premium-redirects-base'); | |
foreach ( $array_base as $key => $row ) { | |
file_put_contents( ABSPATH . 'yoast-redirects-base.csv', $key . ',' . $row[ 'url' ] . "\n", FILE_APPEND ); | |
} | |
$array_plain = get_option('wpseo-premium-redirects-export-plain'); | |
foreach ( $array_plain as $key => $row ) { | |
file_put_contents( ABSPATH . 'yoast-redirects-export-plain.csv', $key . ',' . $row[ 'url' ] . "\n", FILE_APPEND ); | |
} | |
$array_regex = get_option('wpseo-premium-redirects-export-regex'); | |
foreach ( $array_regex as $key => $row ) { | |
file_put_contents( ABSPATH . 'yoast-redirects-export-regex.csv', $key . ',' . $row[ 'url' ] . "\n", FILE_APPEND ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment