近来发现bing的搜索量也越来越大了,为了更好的对必应进行seo优化,我们可以把最新的网站文章链接提交给必应IndexNow,以此来加快必应快速收录网站文章链接,那么我们我如何使用php代码来实现提交网站文章链接到必应IndexNow呢?

PHP代码

<?php
$curl = curl_init();
$postdat = array(
‘host’ => ‘yourdomain.com’,
‘key’ => ‘key’,
‘keyLocation’ => ‘yourdomain.com/key.txt’,
‘urlList’ => array(‘yourdomain.com/1.html’,’yourdomain.com/2.html’),
);
$headers = array(
‘Content-Type: application/json; charset=utf-8′
);
curl_setopt($curl, CURLOPT_URL,’https://api.indexnow.org/indexnow’);
curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($postdat));
curl_setopt($curl, CURLOPT_HTTPHEADER,$headers);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($curl);
curl_close($curl);
echo ‘提交完成’;

该资源来源于WordPress主站,点击下方按钮前往原文页面获取完整内容:

跳转至 WordPress 主站原文页面

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。