代码

以下为php代码,存储成任意名字.php在根目录。使用的时候直接打开 你的网址/名字.php即可。

<?php
require('./wp-blog-header.php');
header("Content-type: text/txt");
header('HTTP/1.1 200 OK');
$posts_to_show = 1000; // 获取文章数量
?>
<?php echo 'http://'.$_SERVER['HTTP_HOST']; ?><?php echo "\n"; ?>
<?php
/* 文章页面 */
header("Content-type: text/txt");
$myposts = get_posts( "numberposts=" . $posts_to_show );
foreach( $myposts as $post ) {
    the_permalink();
    echo "\n";
}
?>
<?php
/* 单页面 */
$mypages = get_pages();
if(count($mypages) > 0) {foreach($mypages as $page) {
    echo get_page_link($page->ID);
    echo "\n";}
}
?>
<?php
/* 博客分类 */
$terms = get_terms('category', 'orderby=name&hide_empty=0' );
$count = count($terms);
if($count > 0){
foreach ($terms as $term) {
    echo get_term_link($term, $term->slug);
    echo "\n";}
}
?>
<?php
 /* 标签(可选) */
    $tags = get_terms("post_tag");foreach ( $tags as $key => $tag ) {
               $link = get_term_link( intval($tag->term_id), "post_tag" );if ( is_wp_error( $link ) ) {return false;
                  $tags[ $key ]->link = $link;}
                  echo $link;
                  echo "\n";}
?>

查询百度收录

fe840000ebb5f76b0090.jpg

可以查询到已收录、未收录。其中未收录还包含收录的不是自己。所以具体应该是2个未收录才是全部没有被百度收录的网址,最后导出数据即可。会一次生成3个文本文档。

最后修改:2020 年 08 月 11 日
如果觉得我的文章对你有用,请随意赞赏