傻大憨

wordpress禁用Rest API

将以下代码插入到functions.php文件中即可

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()]);
});
Published
Categorized as 建站知识 Tagged

By 傻大憨

shadahan.com是一个关注跨境电商、创业话题的网站。

用简站wordpress主题快速建站的操作方法

通过以上步骤,你可以快速搭建一个简洁、实用且安全的WordPress网站,并利用简站主题的优势来简化网站建设过程。

SEO模板网站的wordpress主题最适合google外贸SEO

选择适合您外贸网站的WordPress主题时,考虑上述因素将帮助您创建一个不仅美观,而且对搜索引擎友好的网站,从而提高您的外贸业务可见性和转化率。

wordpress 禁止后台编辑主题

禁止后台编辑主题和插件文件,只需要在wp-config.php中添加以下代码即可。

站易WordPress

站易WordPress是一家专业提供网站建设和运营服务的专业wordpress建站服务商,成立于2014年6月11日。

wordpress外贸建站2B或2C如何选

wordpress外贸建站,就是外贸公司用免费开源好用的wordpress系统,为自己的公司搭建一个网站。因页… Continue reading wordpress外贸建站2B或2C如何选

简站wordpress主题看上去差不多 实际大不一样

表面看差不多,仔细看,细节方面非常不一样。内行看门道,外行看热闹。