WordPress SEO必备功能非插件实现检查文章是否被百度收录,如果未收录可以一键提交给百度收录。SEO的终极目标就是为了获取流量,获取流量的第一步是需要被搜索引擎收录,没收录谈不上流量,百度作为国内第一大搜索引擎,这款非插件实现检查文章是否被收录的神奇还不赶快收下:
非插件检查文章是否被收录解决方法
1、找到主题目录下的functions.php文件
注意:是主题目录下的,路径:/wp-content/themes/你的主题/functions.php
2、将下列代码复制到functions.php中
3、大功告成,浏览下你的文章页,看效果吧!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
/* Plugin Name: Baidu-Accept Plugin URI: http://www.d4v.com.cn Description: 判断当前文章是否被百度收录,若没有被收录则可点击提交至百度,加速收录!(此插件在文章页面仅管理员可见) Version: 1.0 Author: Jovae Author URI: http://www.d4v.com.cn License: GPL */ function d4v($url){ $url='http://www.baidu.com/s?wd='.$url; $curl=curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); $rs=curl_exec($curl); curl_close($curl); if(!strpos($rs,'没有找到')){ return 1; }else{ return 0; } } add_filter( 'the_content', 'baidu_submit' ); function baidu_submit( $content ) { if( is_single() && current_user_can( 'manage_options') ) if(d4v(get_permalink()) == 1) $content="<p align=right>百度已收录(仅管理员可见)</p>".$content; else $content="<p align=right><b><a style=color:red target=_blank href=http://zhanzhang.baidu.com/sitesubmit/index?sitename=".get_permalink().">百度未收录!点击此处提交</a></b>(仅管理员可见)</p>".$content; return $content; } |
2023云服务器疯狂降价!
①阿里云:2023阿里云服务器38元一年起,更多配置价格查看(有高配)
②腾讯云:腾讯云2核4G服务器8M带宽70元一年,更多配置及报价查看(有高配)
③华为云:华为云1核2G服务器60元一年,更多1c2g/2c4g/2c8g/4c8g/8c16g/16c32g...
发表评论