{"id":3957,"date":"2014-12-16T10:40:33","date_gmt":"2014-12-16T12:40:33","guid":{"rendered":"http:\/\/blog.turbosite.com.br\/?p=3957"},"modified":"2014-12-16T10:40:33","modified_gmt":"2014-12-16T12:40:33","slug":"remover-versao-e-outras-informacoes-que-o-wordpress-insere-em-seu-site","status":"publish","type":"post","link":"https:\/\/www.turbosite.com.br\/blog\/remover-versao-e-outras-informacoes-que-o-wordpress-insere-em-seu-site\/","title":{"rendered":"Remover vers\u00e3o e outras informa\u00e7\u00f5es que o WordPress insere em seu site"},"content":{"rendered":"<p>Quando utilizamos o WordPress, automaticamente \u00e9 inserido\u00a0em seu conte\u00fado HTML ( mais especificamente no HEAD ) informa\u00e7\u00f5es como, feed, rss, vers\u00e3o e outras informa\u00e7\u00f5es que na maioria das vezes, n\u00e3o as utilizamos e no final das contas, serve apenas para abrir brechas de seguran\u00e7a.<\/p>\n<p>Para removermos estas informa\u00e7\u00f5es, iremos criar uma fun\u00e7\u00e3o e para isso, ser\u00e1 necess\u00e1rio alterar o functions.php de seu tema. Adicione no final do arquivo o seguinte conte\u00fado.<\/p>\n<pre class=\"whitespace-before:2 whitespace-after:2 lang:php decode:true\" title=\"Remover informa\u00e7\u00f5es e a\u00e7\u00f5es do WordPress\">function remove_extra_informations()\n{\n    remove_action( 'wp_head', 'feed_links_extra', 3); \/\/ Remover a categoria feeds\n    remove_action( 'wp_head', 'feed_links', 2); \/\/ Remover Feeds de Post e Coment\u00e1rios \n    remove_action( 'wp_head', 'rsd_link' );\n    remove_action( 'wp_head', 'wlwmanifest_link' );\n    remove_action( 'wp_head', 'wp_generator' ); \/\/ Remove vers\u00e3o do WordPress\n\n    \/\/--  Esta parte \u00e9 conectada ao gerador de FEED --\/\/\n    remove_action( 'rss2_head', 'the_generator' );\n    remove_action( 'rss_head',  'the_generator' );\n    remove_action( 'rdf_header', 'the_generator' );\n    remove_action( 'atom_head', 'the_generator' );\n    remove_action( 'commentsrss2_head', 'the_generator' );\n    remove_action( 'opml_head', 'the_generator' );\n    remove_action( 'app_head',  'the_generator' );\n    remove_action( 'comments_atom_head', 'the_generator' );\n}\n\nadd_action( 'after_setup_theme', 'remove_extra_informations' );<\/pre>\n<blockquote><p><strong>Dica<\/strong>: Voc\u00ea pode verificar\u00a0todas as informa\u00e7\u00f5es utilizando <code>var_dump<\/code> ou <code>print_r<\/code> na vari\u00e1vel\u00a0<code>$GLOBALS['wp_filter']<\/code> .<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Uma outra dica \u00e9 remover informa\u00e7\u00f5es de vers\u00e3o que constam\u00a0nos arquivos CSS\/Javascript.<\/p>\n<pre class=\"whitespace-before:2 whitespace-after:2 lang:php decode:true \" title=\"Remover vers\u00e3o dos arquivos CSS\/Javascript\">function remove_src_version( $src )\n{\n    global $wp_version;\n\n    $version_str = '?ver='.$wp_version;\n    $version_str_offset = strlen( $src ) - strlen( $version_str );\n\n    if( substr( $src, $version_str_offset ) == $version_str )\n    {\n        return substr( $src, 0, $version_str_offset );\n    }\n    else\n    {\n        return $src;\n    }\n}\n\nadd_filter( 'script_loader_src', 'remove_src_version' );\nadd_filter( 'style_loader_src', 'remove_src_version' );<\/pre>\n<p>&nbsp;<\/p>\n<p>Mais uma\u00a0dica, esta \u00e9 utilizar o plugin <a href=\"http:\/\/codecanyon.net\/item\/hide-my-wp-no-one-can-know-you-use-wordpress\/4177158\">Hide My WP<\/a>\u00a0($22,00). Este oculta os diret\u00f3rios do WordPress como voc\u00ea precisar. Exemplo, alterar \/wp-content para \/assets. O plugin est\u00e1 dispon\u00edvel no Code Canyon e \u00e9 pago.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quando utilizamos o Wordpress, automaticamente \u00e9 inserido informa\u00e7\u00f5es como: vers\u00e3o, link para Feed\/RSS, XML&#8230; Vamos ensinar como remover essas informa\u00e7\u00f5es.<\/p>\n","protected":false},"author":1,"featured_media":3959,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,28,30],"tags":[462,544,547,548],"class_list":["post-3957","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dicas","category-tutoriais","category-wordpress-2","tag-ocultar-informacoes-wordpress","tag-remove-generator-wordpress","tag-remover-informacoes-wordpress","tag-remover-versao-wordpress"],"_links":{"self":[{"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/posts\/3957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/comments?post=3957"}],"version-history":[{"count":0,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/posts\/3957\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/media\/3959"}],"wp:attachment":[{"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/media?parent=3957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/categories?post=3957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.turbosite.com.br\/blog\/wp-json\/wp\/v2\/tags?post=3957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}