0

如何 Debug WordPress 的 Pingback 功能

 2 years ago
source link: https://www.ixiqin.com/2021/10/how-to-debug-the-pingback-wordpress-functions/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

如何 Debug WordPress 的 Pingback 功能

前两天,朱峰老师在写博客的时候,引用了我的文章,发现我的博客并没有开通 Pingback。提醒我开通以后,发现依然没有效果。

于是进入了 Debug 模式。

Pingback 如何 Debug

PingBack 是基于 XML 构建的协议,因此,如果你需要调试的话,需要自己发送 XML 请求,以通知 WordPress 进行 Pingback 记录。

你需要构建一个 XML 文件,其中的内容如下

<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>pingback.ping</methodName>
<params>
 <param>
  <value>
   <!-- source,发起请求的文章,即要引用别人文章的文章 --> 
   <string>https://blog.andie.im/blog-is-back/</string>
  </value>
 </param>
 <param>
  <value>
   <!-- target,被引用的文章,即他人的文章 -->
   <string>https://www.ixiqin.com/2021/10/more-and-more-good-a-lightweight-application-server/</string>
  </value>
 </param>
</params>
</methodCall>

将上述的 URL 修改为你自己的以后,就可以在命令行中对 WordPress 发起请求,以实现 PingBack 功能。

curl -X POST -d @pingback.xml https://domain/xmlrpc.php #将 Domain 替换为你自己的博客地址

发送成功后,你会看到这样的一个提示,就说明你的 Pingback 发起成功了,接下来要做的,就是在 WordPress 的评论页面去给 Pingback 进行放行了。

朱峰老师的文章

Reference

https://wordpress.org/support/topic/inbound-pingbacks-not-working/

发布日期:2021年10月9日
d9b147a3b7e8d89bf4a5ddd0518bca30?s=85&d=monsterid&r=g

作者:白 宦成

Generalist, contact me at [email protected]

查看白 宦成的所有文章。

发表评论 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论

显示名称 *

电子邮箱地址 *

网站地址


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK