wordpress移除不必要的資訊

2022-08-17 09:39:15 字數 1961 閱讀 2993

1.移除不必要的頭部資訊

//

移除不必要head資訊

remove_action('wp_head', 'wp_generator' ); //

去除版本資訊

remove_action('wp_head', 'wlwmanifest_link');

remove_action('wp_head', 'rsd_link' );//

清除離線編輯器介面

remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );//

清除前後文資訊

remove_action('wp_head', 'feed_links',2);

remove_action('wp_head', 'feed_links_extra',3 );//

清除feed資訊

remove_action('wp_head', 'wp_shortlink_wp_head',10,0 );

2.清除dashboard小工具

1

//清除dashboard小外掛程式

2function

remove_dashboard_widgets()

22 add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );

3.禁止wordpress顯示更新資訊

1

//禁用更新提示

2 add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); //

關閉核心提示

34 add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); //

關閉外掛程式提示

56 add_filter('pre_site_transient_update_themes', create_function('$a', "return null;")); //

關閉主題提示

78 remove_action('admin_init', '_maybe_update_core'); //

禁止 wordpress 檢查更新

910 remove_action('admin_init', '_maybe_update_plugins'); //

禁止 wordpress 更新外掛程式

1112 remove_action('admin_init', '_maybe_update_themes'); //

禁止 wordpress 更新主題

4.遮蔽後台頁尾資訊

1

//遮蔽後台頁尾資訊

2function change_footer_admin ()

3 add_filter('admin_footer_text', 'change_footer_admin', 9999);

4function change_footer_version()

5 add_filter( 'update_footer', 'change_footer_version', 9999);

5.遮蔽左上logo

1

//遮蔽左上logo

2function

annointed_admin_bar_remove()

7 add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);

angularjs移除不必要的 watch

在我們的 web page 特別是移動裝置上,太多的 angular watch 將可能導致效能問題。這篇文章將解釋如何去移除額外的 watch 提高你的應用程式效能。watch 如果不再使用,我們最好將其釋放掉,在 angular 中我們可以自由的選擇在什麼時候將 watch 從 watch 列表...

linux安全 移除不必要的服務

鳥哥的 一 關閉服務 關閉的方法有很多,通常我是使用 usr sbin setup 來關閉的,只是用這樣的方式來關閉的話,需要重新啟動 linux 比較麻煩一些些,如果您是使用我們這個網頁的 redhat6.1 系統的話,那就執行 usr sbin setup 吧!然後選擇 system servi...

避免不必要的float

float中文翻譯為浮動,很形象的翻譯,在css很常用,當你需要吧兩個塊級元素定排放在同一高度上經常會用到float,先看一下float的 屬性。先看一下float可能的值 float left 元素向左浮動 float right 元素向右浮動 float none 不浮動 float inher...