Clean Code in WordPress

Clean Code in WordPress, toti stim ca WordPress adauga mult cod inutil si de unele lucruri nu avem nevoie.

Adauga codul in functions.php din Theme si vei scapa de multe coduri.

 

function disable_wp_emojicons() {
 // all actions related to emojis
 remove_action( 'admin_print_styles', 'print_emoji_styles' );
 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
 remove_action( 'wp_print_styles', 'print_emoji_styles' );
 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
 // filter to remove TinyMCE emojis
 add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
 }
 add_action( 'init', 'disable_wp_emojicons' );
 remove_action( 'wp_head', 'wp_shortlink_wp_head');
 remove_action('wp_head', 'rsd_link');
 remove_action('wp_head', 'wlwmanifest_link');
 remove_action('wp_head', 'wp_generator');
 remove_action('wp_head', 'start_post_rel_link');
 remove_action('wp_head', 'index_rel_link');
 remove_action('wp_head', 'adjacent_posts_rel_link');
 //Disable RSS Feeds functions
 add_action('do_feed', array( $this, 'disabler_kill_rss' ), 1);
 add_action('do_feed_rdf', array( $this, 'disabler_kill_rss' ), 1);
 add_action('do_feed_rss', array( $this, 'disabler_kill_rss' ), 1);
 add_action('do_feed_rss2', array( $this, 'disabler_kill_rss' ), 1);
 add_action('do_feed_atom', array( $this, 'disabler_kill_rss' ), 1);
 if(function_exists('disabler_kill_rss')) {
 function disabler_kill_rss(){
 wp_die( _e("No feeds available.", 'ippy_dis') );
 }
 }
 //Remove feed link from header
 remove_action( 'wp_head', 'feed_links_extra', 3 ); //Extra feeds such as category feeds
 remove_action( 'wp_head', 'feed_links', 2 ); // General feeds: Post and Comment Feed

Articole asemanatoare:

  1. Cele mai bune pluginuri WordPress SEO by Yoast
  2. Duplicate content WordPress
  3. Site in WordPress

Lasă un răspuns

Adresa ta de email nu va fi publicată. Câmpurile necesare sunt marcate *

*

Poți folosi aceste etichete HTML și atribute: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe
About Skinnerul

Te salut. Lucrez in domeniul SEO - Programare - Web Design incepand din anul 2005, despre asta o sa vorbim aici.
Detin o retea de site-uri si ofer servicii de web design clientilor care au nevoie de mine.
Cere sfaturi, da-mi un pont, critica-ma, fii bine venit!