今天给谷歌还有头条搜索/搜狗平台提交一下文章。想着文章太多 虽然用了sitemap,但我还是喜欢直接提交链接 ,那样猛烈点
网站根目录新建geturl.php文件,将代全部码粘贴通过浏览器访问该文件即可(例如:域名/geturl.php)
代码如下
<?php
include ( "wp-config.php" ) ;
require_once (ABSPATH.'wp-blog-header.php');
global $wpdb;
$qianzui = "http://blog.smoxo.cn/";//网站域名
$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://www.ly522.com/?p=520)就使用这个代码
<?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
暂无评论内容