WordPress终极优化指南–删除REST API链接
Warning: Undefined variable $output in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/functions.php on line 68
本文共411个字,预计阅读时间需要2分钟 发布时间: 2024-10-4 共3.4K人阅读
WordPress终极优化指南–删除REST API链接
教程总目录:WordPress终极优化指南
WordPress REST API是用来跟其他应用程序通信的。一般用来自己开发一些小工具之类,大多数网站都不会使用到。知识兔可以禁用他。
网站每个页面都有一个这个API的链接。如下
使用下面代码来禁用:
add_action('after_setup_theme', function(){ remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );});
写入functions.php保存即可
下载仅供下载体验和测试学习,不得商用和正当使用。
常见问题FAQ
Warning: foreach() argument must be of type array|object, string given in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/parts/author-box.php on line 12