wordpress禁用Rest API
add_filter("json_enabled", "__return_false");
add_filter("json_jsonp_enabled", "__return_false");
add_filter("rest_enabled", "__return_false");
add_filter("rest_jsonp_enabled", "__return_false");
remove_action("init", "rest_api_init");
remove_action("rest_api_init", "rest_api_default_filters", 10);
remove_action("parse_request", "rest_api_loaded");
remove_action("wp_head", "rest_output_link_wp_head", 10);
remove_action("template_redirect", "rest_output_link_header", 11);
remove_action("auth_cookie_malformed", "rest_cookie_collect_status");
remove_action("auth_cookie_expired", "rest_cookie_collect_status");
remove_action("auth_cookie_bad_username", "rest_cookie_collect_status");
remove_action("auth_cookie_bad_hash", "rest_cookie_collect_status");
remove_action("auth_cookie_valid", "rest_cookie_collect_status");
add_filter("rest_authentication_errors", function () {
return new WP_Error("rest_disabled", __("The REST API on this site has been disabled."), ["status" => rest_authorization_required_code()]);
});
wordpress禁用Feed
function wpjam_feed_disabled()
{
wp_die("Feed已经关闭, 请访问网站<a href="" . get_bloginfo("url") . "">首页</a>!");
}
add_action("do_feed", "wpjam_feed_disabled", 1);
add_action("do_feed_rdf", "wpjam_feed_disabled", 1);
add_action("do_feed_rss", "wpjam_feed_disabled", 1);
add_action("do_feed_rss2", "wpjam_feed_disabled", 1);
add_action("do_feed_atom", "wpjam_feed_disabled", 1);
wordpress禁用xmlrpc
add_filter("xmlrpc_enabled", "__return_false");
add_filter("xmlrpc_methods", function ($methods) {
unset($methods["pingback.ping"]);
return $methods;
});
来源 https://www.jianzhanpress.com/?cat=1
WordPress简介
WordPress是使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。也可以把 WordPress当作一个内容管理系统(CMS)来使用。
WordPress是一款个人博客系统,并逐步演化成一款内容管理系统软件,它是使用PHP语言和MySQL数据库开发的,用户可以在支持 PHP 和 MySQL数据库的服务器上使用自己的博客。
WordPress有许多第三方开发的免费模板,安装方式简单易用。不过要做一个自己的模板,则需要你有一定的专业知识。比如你至少要懂的标准通用标记语言下的一个应用HTML代码、CSS、PHP等相关知识。
WordPress官方支持中文版,同时有爱好者开发的第三方主题模板,如简站wordpress。WordPress拥有成千上万个各式插件和不计其数的主题模板样式。