
在网站的运营中,网络搜索引擎的爬取速度可能会慢些,所以就需要我们手动去操作提高收录率,今天给很多平台提交了一下文章。有时候想着文章太多,虽然用了sitemap但是不精准,所以还是喜欢直接提交链接 ,那样猛烈点。
食用:网站根目录新建geturl.php文件,将代全部码粘贴通过浏览器访问该文件即可(例如:域名/geturl.php),代码中也写注释可看下。
代码如下:
<?phpinclude ( "wp-config.php" ) ;require_once (ABSPATH.'wp-blog-header.php');global $wpdb;$qianzui = "https://soujiz.com/";//网站域名$houzui = ".html";//文章后缀$sql="SELECT ID FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC ";$myrows = $wpdb->get_results($sql);foreach ($myrows as $b) {echo $qianzui;echo $b->ID;echo $houzui."<br/>";}?><?php include ( "wp-config.php" ) ; require_once (ABSPATH.'wp-blog-header.php'); global $wpdb; $qianzui = "https://soujiz.com/";//网站域名 $houzui = ".html";//文章后缀 $sql="SELECT ID FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC "; $myrows = $wpdb->get_results($sql); foreach ($myrows as $b) { echo $qianzui; echo $b->ID; echo $houzui."<br/>"; } ?><?php include ( "wp-config.php" ) ; require_once (ABSPATH.'wp-blog-header.php'); global $wpdb; $qianzui = "https://soujiz.com/";//网站域名 $houzui = ".html";//文章后缀 $sql="SELECT ID FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC "; $myrows = $wpdb->get_results($sql); foreach ($myrows as $b) { echo $qianzui; echo $b->ID; echo $houzui."<br/>"; } ?>
如果你的是ID方式的话,比如:你的文章链接是这样的 https://soujiz.com/?p=4592,就使用这个代码:
<?phpinclude ( "wp-config.php" ) ;require_once (ABSPATH.'wp-blog-header.php');global $wpdb;$sql="SELECT guid FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC ";$myrows = $wpdb->get_results($sql);foreach ($myrows as $b) {echo $b->guid."<br/>";}?><?php include ( "wp-config.php" ) ; require_once (ABSPATH.'wp-blog-header.php'); global $wpdb; $sql="SELECT guid FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC "; $myrows = $wpdb->get_results($sql); foreach ($myrows as $b) { echo $b->guid."<br/>"; } ?><?php include ( "wp-config.php" ) ; require_once (ABSPATH.'wp-blog-header.php'); global $wpdb; $sql="SELECT guid FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY ID DESC "; $myrows = $wpdb->get_results($sql); foreach ($myrows as $b) { echo $b->guid."<br/>"; } ?>
这样你的网站的所有文章链接就可以获取到了,用于提交就方便多了。下面截取部分效果图如下:

© 版权声明
THE END
暂无评论内容