115 Responses

  1. Ben
    Ben August 6, 2009 at 6:12 am |

    The other problem comes from plugin that, as you said in the begining of the article, don’t use wp_enqueue. We can get rid of those by removing the wp_head filter the plugin uses to append the script/style.

    It would be so good if every plugins were giving you the chance to say where they are allowed to include styles and scripts. Most of them just include on every page, regardless of if the script is used or not…

    Reply
    1. swapnil
      swapnil June 26, 2012 at 12:20 pm |

      Ben,
      Thanks for the help. In some plugins they are using and script tags. How to convert them into wp_enqueue_style(); and wp_enqueue_script();

      Please help me. And i would also like to know where should i create a single js file to merge all in it…Thanks in advance..

      Reply
  2. links for 2009-08-06 | Links | WereWP
  3. J Mehmett
    J Mehmett August 6, 2009 at 10:36 am |

    Short, descriptive and sweet tip. Thanks for sharing this with us.

    I figured out that, the script can be registered, only, when needed:

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
       if ( !is_page('Contact') ) {
    	wp_deregister_script( 'contact-form-7' );
         }
    }

    So it will load that script only on Contact page…

    Reply
  4. Banago
    Banago August 6, 2009 at 4:44 pm |

    Really useful technique. I have been looking for something like this.

    The solution that J Mehmett added to the script is very nice too.

    Great job.

    Reply
  5. takayukister
    takayukister August 6, 2009 at 5:19 pm |

    Hi Justin! Thank you for nice articles every time :)

    To Contact Form 7 users, you can also use WPCF7_LOAD_JS constant to control JavaScript loading.

    http://ideasilo.wordpress.com/2009/05/31/contact-form-7-1-10/

    Takayuki Miyoshi (author of Contact Form 7)

    Reply
  6. brainsolid
    brainsolid August 7, 2009 at 12:16 pm |

    Hi, Justin!
    Sorry for offtopic)
    Your widget “WordPress-o-Sphere” in sidebar — is this just text widget or some kind of plugin?

    Reply
  7. Gaby
    Gaby August 8, 2009 at 11:14 am |

    Oh this is a wonderful tip :D I have many plugins so I’ve been thinking of trying to reduce the load they put on the site and this could really help. Thank you!

    Reply
  8. Keith Purkiss (Alex Jeffreys Student)
    Keith Purkiss (Alex Jeffreys Student) August 9, 2009 at 12:56 pm |

    Thanks Justin,

    That’s a good point and it’s a good idea to tidy it all up into one style sheet.
    I’m trying to keep my plug-ins to a minimum and havent looked at this yet, but one link widget I had uses a remote file which is also going to slow it down. Possible I could copy that file onto my server although that would mean updating it regularly.

    Thanks

    Keith

    Reply
  9. WordPress trick: Disable plugin stylesheet
  10. Joe Somebody
    Joe Somebody August 10, 2009 at 9:19 pm |

    This couldn’t have come at a better time. One thing that has always annoyed me about Contact Form 7 was the fact that it loaded what was only needed on the contact page onto every single page of the site. I now have exactly what I need to create cleaner and meaner WordPress based sites.

    Reply
  11. Simon Wilby
    Simon Wilby August 11, 2009 at 12:53 am |

    Great! Timely script for me. Just checking out my scripts and found out I need to disable some styles of my page.

    Reply
  12. Gilbert
    Gilbert August 13, 2009 at 1:18 am |

    Hi Justin,

    Love your articles in general.
    Just a question out of the scope of this article: how do you setup the “notify me of followup comments via e-mail” as you are doing below?

    Are you using “http://txfx.net/code/wordpress/subscribe-to-comments/”?

    Reply
  13. V.C
    V.C August 14, 2009 at 5:57 pm |

    It’s really useful.
    But what about the others?
    How could I disable them :-<

    Reply
  14. WordPress Weekend Resources - August 14, 2009 | Theme Lab
  15. Wordpress Blog Services - WordPress Weekend Resources - August 14, 2009
  16. Eduard Seifert
    Eduard Seifert August 15, 2009 at 5:45 pm |

    Hi Justin, thank for this really handy tip. Now i know how to disable the CSS from the Cleaner Gallery Plugin without commentig out every time you update your plugin.

    /**
     * Remove CSS Styles added by Plugins
     * @note use plugin directory name
     * @see  http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles
     */
    function my_deregister_styles() {
    	wp_deregister_style( 'cleaner-gallery' );
    }
    my_deregister_styles();

    Thank you very much.

    Reply
  17. Como desativar scripts e estilos no wordpress | Ajuda Wordpress em Português
  18. Como desactivar scripts y estilos | Zona-WordPress
  19. GB Pics
    GB Pics August 21, 2009 at 11:42 am |

    Short, descriptive and sweet tip.

    Reply
  20. החלקה יפנית
    החלקה יפנית August 22, 2009 at 11:05 am |

    That wasvery usefull to all of us.
    The good thing in WP is that it’s very friendly, has a lot of plugins and a lot of knowledge such as Justin’s. But it’s quiet confusing for beginners.
    I moved from shared blogging system towards WP.
    Can you refer for the beginners any simple website, beside your most important post ?

    Reply
  21. Pen Whitening
    Pen Whitening August 22, 2009 at 2:52 pm |

    Thanks for simplifying this otherwise complex process so even a WP newbie like me can tackle this performance optimization. However, I will leave the file merge to an expert.

    Reply
  22. Jonas8
    Jonas8 August 23, 2009 at 11:36 am |

    Very useful tip. When a project tends to evolve, a plethora of plugins tend to follow. Advice like this can make all the difference. Thanks!

    Reply
  23. Daniel
    Daniel August 25, 2009 at 9:48 am |

    This is a really great tutorial. One of my websites has become insanely slow, and I followed these instructions and it helped a lot! Thanks mate!

    Reply
  24. 10 WordPress ‘HOW-TO’ to Give it the Quality it Deserves
  25. 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves | Webmaster Tips
  26. Teresa White
    Teresa White August 26, 2009 at 5:11 pm |

    Thanks for great tips. I followed your instructions, changed theme and my blog loads 5 times faster

    Reply
  27. 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves | huibit05.com
  28. 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves | SeanBurdick
  29. Paula
    Paula August 28, 2009 at 8:19 am |

    Some of the blog I frequent on a regular basis could do with reading this article. I’ll discretely pass this post onto some of them. Thanks

    Reply
  30. Bookmarks for 21.08.2009 through 26.08.2009 - mafflog
  31. WordPress trick: Disable plugin stylesheet « Test Blog
  32. Chris
    Chris August 31, 2009 at 1:40 pm |

    this is a useful techniques.thanks for a nice article i might be thinking to change my theme and this will be a very useful guide for me.

    Reply
  33. David
    David August 31, 2009 at 3:42 pm |

    Tips on making this work better

    I’d add one more – use a plugin like Headspace2, it enables you to load scripts, css, or just raw head data on a post by post basis, after you’ve stopped them loading globally. So I do that with wp-polls, so the poll css is not on every page when I only need it on an occasional post.

    Reply
  34. Kim
    Kim September 3, 2009 at 9:52 am |

    Thanks for this Justin. I have several plugins that I have customized the styles for and now I don’t have to worry about editing their respective stylesheets every time the plugin is updated.

    Reply
  35. Judith
    Judith September 5, 2009 at 8:39 am |

    At the beginning I also tried out every plugin and widget available. But it really slowed down my whole page. Also it sometimes looks unprofessional if you have to many widgets and plugins. But thank you Justin for providing us with a script. That way you don’t have to uninstall everything – what I always did until now.

    Reply
  36. Aktuelle Links (gespeichert vom 04.09.2009 bis zum 05.09.2009) « Der Webanhalter
  37. jonty
    jonty September 6, 2009 at 3:52 am |

    excellent as always !
    I’m goonna check the Disabling javascript, I have to fix something around that using that snipe..

    Reply
  38. 10 секретов и примочек для wordpress | cooledit
  39. Stefan
    Stefan September 20, 2009 at 6:25 pm |

    Please pardon the clueless here but: “deregister as many stylesheets as you need”
    I can get one stylesheet to “de-regester” but I can not figure out the syntax to de-regester 2 stylesheets without breaking functions.php.
    I guess I’m looking for an example with 2 de-regestered stylesheets.
    Thanks, S

    Reply
  40. Kim
    Kim September 20, 2009 at 6:49 pm |

    @Stefan: Did you try listing each handle as follows:

    function my_deregister_styles() {
    	wp_deregister_style( 'wp-pagenavi', 'cleaner-gallery' );
    }
    Reply
  41. Stefan
    Stefan September 20, 2009 at 8:00 pm |

    @Kim: Yes i did, whatever handle is in the second spot (cleaner-gallery in your example) is still being requested when I look in firebug at the css requests for that page.
    I thought perhaps I was missing a space or something but no joy. I even swapped around the handle’s and only the first one is no longer requested.
    I am trying to de-regester wp-postratings, theme-my-profile and theme-my-login, anyone of these in the first position gets de-regestered second one is still requested.
    It must be my syntax though I copied the examples………hmmmm.

    Reply
  42. Daniel Suffolk
    Daniel Suffolk September 29, 2009 at 3:34 pm |

    A great read thank you, I have only just started playing around with wordpress and your tips have come in handy,

    Reply
  43. Dave
    Dave October 2, 2009 at 12:19 am |

    @Stefan, did you find a solution to de-registering more than one script? I can’t figure it out either.

    Reply
  44. Dave
    Dave October 2, 2009 at 12:21 am |

    Of course, as soon as I ask the question, I figure it out. Very simple:

    function my_deregister_styles() {
    	wp_deregister_style( 'wp-pagenavi' );
    	wp_deregister_style( 'contact-form-7' );
    }
    Reply
  45. Jack
    Jack October 10, 2009 at 10:47 am |

    I can put in the header instead of the functions.php?

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
    	wp_deregister_script( 'contact-form-7' );
    }

    Or put the function in functions.php and add_action the header?

    Reply
  46. Kim
    Kim October 10, 2009 at 11:02 am |

    @Jack: You would add all of that code to your functions.php file, and it will remove the javascript from the header automatically. You don’t need to edit your header.php file at all.

    Reply
  47. Stjepan Tafra
    Stjepan Tafra October 22, 2009 at 11:15 am |

    Is it possible, using this method, to prevent NextGen gallery from inserting the version number into tags?

    Reply
  48. 12 Lesser Known But Useful WordPress Hacks
  49. Wordpress: Performance optimieren | bertdesign.de
  50. How to Disable Scripts And Styles : Wordpress Hack
  51. Darrin
    Darrin November 8, 2009 at 1:28 pm |

    Ooh excellent post. I didn’t know that this was possible. I was always afraid to mess with the plugins for fear of breaking it altogether. Time to go mess with my site and hope I don’t break it to bad.

    Reply
  52. Disabling Scripts and CSS styles in WordPress | Netvivs
  53. Ryan Isra
    Ryan Isra November 9, 2009 at 3:25 am |

    Nice post, for those who weren’t advanced in programming, especially web programming.

    Reply
  54. Devin
    Devin November 9, 2009 at 4:17 pm |

    Thanks for posting this Justin. I just added the WP Navi deregister to my list of useful Thematic filters- even though it’s only sorta related. Too useful to leave off though: http://wordpresstheming.com/2009/10/useful-thematic-filters/.

    Reply
  55. Benjamin
    Benjamin December 3, 2009 at 9:37 pm |

    This worked great: but is there a way to enable it only on certain templates instead of the exact page? For instance if I want a certain script to be allowed on single.php pages?

    Thanks in advance! I’m still wrapping my head around much of this code!

    Reply
  56. Thomas Carter
    Thomas Carter December 22, 2009 at 4:03 pm |

    @Ben for sure i’ve just done this, based on J Mehmett’s great comment (the 2nd comment)

    Based on your example:

    if(!is_single()){
    wp_deregister_script(‘the-script’);
    }

    So if the page is not single.php the script will be de-registered!

    Reply
  57. Funktionen, Javascripte und CSS Styles aus wp_head entfernen « design & programmierung
  58. 20+ Tips Lengkap Optimasi WordPress
    20+ Tips Lengkap Optimasi WordPress January 18, 2010 at 10:07 am |
  59. How to load Javascript on specific pages in Wordpress – Web Design / Development | FLDtrace
  60. Increasing The Speed Of Your WordPress Blog | DevWebPro
  61. Some WordPress Stuff « i can haz .NET
  62. Juri
    Juri April 8, 2010 at 2:49 pm |

    Thanks for this great hack! However, when I applied it all other scripts stopt to function eventhough they where present in the head.

    This appeared to be caused by the fact that plugin also wrote an extra inline script in the head. So check for extra write functions in the php.

    Reply
  63. bLu
    bLu May 5, 2010 at 8:55 am |
    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
    	if ( !is_page('contact') ) {
    		wp_deregister_script( 'contact-form-7' );
    	}
    }
    
    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    
    function my_deregister_styles() {
    	if ( !is_page('contact') ) {
    		wp_deregister_style( 'contact-form-7' );
    		wp_deregister_style( 'style' ); 
    	}
    } 

    i use contact form 7 on multiple pages ( eg: contact, addnote, feedback )
    how can i do this ?

    Reply
  64. acebone
    acebone May 11, 2010 at 3:00 pm |

    Hi!

    I was thinking:

    Since all your JS and CSS files are registered, Wordpress KNOWS what you need right?

    So why not let WP gather all those files into on big CSS file and one big JS file automatically?

    That way you’d load ONE stylesheet and ONE javascript file, and you’d never have to think about it.

    It could even do some compacting before serving them (and then cache them of course)

    I was actually searching for a plugin that did this, which is why I found this post.

    Is it a feasible idea?

    Is it already done, and if so, where?

    Regards
    Acebone

    Reply
  65. Codrin
    Codrin May 13, 2010 at 5:18 pm |

    adding all js / css into one file will decrease the website performance

    load the css & js only on the pages that you need.

    Reply
  66. acebone
    acebone May 14, 2010 at 8:14 am |

    I am talking about aggregating the scripts in the queue

    So you could still modify the queue on a pr. page basis. Everything would be business as usual, except wordpress would combine whatever CSS and JS is needed for the particular page

    This should almost be default wordpress behaviour come to think about it

    Reply
  67. John
    John May 15, 2010 at 8:37 am |

    Is there any way at all to disable javascript from loading from a certain plugin if that plugin does not have a wp enqueue script handle? Or is there a tutorial somewhere that teaches you how to manually add in a handle? The plugin in question is WP Forum.

    Reply
  68. Carlo
    Carlo May 16, 2010 at 3:34 am |

    I’d like to know this as well.

    I’m using a plugin that doesn’t use wp_enqueue_script and instead echoes tags in a function called addHeaderCode(). This function is then added to the wp_head with add_action("wp_head", array(&$this, "addHeaderCode"));

    When I try to do something like remove_action('wp_head', addHeaderCode); nothing happens because the function name gets prepended with what looks to me like a session ID? (i.e. 1db0e0f7ce9..) When I include it, the action is removed.

    Am I doing this right? Will appreciate any help! Thanks!

    Reply
  69. 12 Lesser Known But Useful WordPress Hacks | php tutorial
  70. Bill Bennett
    Bill Bennett May 28, 2010 at 9:52 pm |

    I have trouble with this from the outset.

    If I open wp-contact-form-7.php, there’s no

    wp_enqueue_script

    What’s going on?

    Reply
  71. Micah
    Micah July 16, 2010 at 3:02 am |

    I only wish I had found this earlier! What a great tutorial. If only authors would be more responsible about when to add scripts and styles, we wouldn’t need to resort to this method as much.

    One of the most notorious for bulking up themes is NextGEN. While it’s a wonderful plugin for Wordpress, I can’t STAND that a ton of JS and CSS is added to both wp_head and wp_footer. The author also doesn’t include any method that specifies these scripts and styles only load on pages with galleries!

    While this deregister method takes care of some of the unnecessary files on pages which don’t have galleries, it doesn’t take care of the version NextGEN version number, CoolIris/PicLens, and additional on-page script in the footer. Has anyone ever looked into this and how to compliment this method to take care of the rest of these scripts and styles?

    Reply
    1. Derek
      Derek September 28, 2010 at 6:29 pm |

      I had a look through the NEXTGEN plugin and found that there is an easier way to turn off the registration of scripts:

      NGG_SKIP_LOAD_SCRIPTS

      so in your functions.php file just add

      define('NGG_SKIP_LOAD_SCRIPTS',TRUE);

      wohoo!

      Reply
  72. Lisa
    Lisa August 4, 2010 at 3:30 am |

    Is it possible that this code stopped working?

    I have tried several plugins, including contact form 7 and there is no wp_enqueue_script

    Reply
  73. Optimizing Your Wordpress Blog
    Optimizing Your Wordpress Blog September 7, 2010 at 2:03 am |
  74. Tutorial: Geschwindigkeit und Ladezeit von Webseiten optimieren » Webseite, Plugin, Tipp, Bilder, Plugins, Cache » IhrWebprofi.at
  75. No Will No Skill » Blog Archive » How to disable scripts and styles in Wordpress
  76. Jk_
    Jk_ November 16, 2010 at 4:02 am |

    Thanks Justin.

    Really useful stuffs around here!

    Cheers.

    Reply
  77. Adam Capriola
    Adam Capriola December 19, 2010 at 9:00 pm |

    Great guide!

    I am having trouble removing some scrips and css files generated by plugins though, because they aren’t generating actual files in some cases, but just adding code to the header.

    It’s annoying and I’m only having some mild success sniffing the culprits out. If you search for “wp_head” in some plugins you’ll see something like add_action(‘wp_head’, ‘somefunction’)

    So in functions.php you can just repeat that, but with remove_action (and then add conditionals for when you really do want it to show).

    However, some plugins are sneaky and I am having trouble finding the wp_head add actions. :( Audio Player, for example is one I can’t seem to pick out.

    Reply
  78. WordPress - Findable Designs
    WordPress - Findable Designs January 10, 2011 at 7:44 pm |
  79. Andrei
    Andrei January 13, 2011 at 8:06 pm |

    Yup :D great tips. J Mehmett’s solution solved a big problem for me. Thank you very much :)

    Reply
  80. David Alexander
    David Alexander January 28, 2011 at 10:05 am |

    This is one of the best wordpress tutorials I have stumbled upon in a long time. I cannot believe these plugins do not have some default checking facility to see if they are needed, especially in the example of contact forms where they are often on one page, and the site could have hundreds of pages/posts. Great tips on speeding up Wordpress, I think this is going to become an operation I perform on nearly every site build from here on in. Keep up the good work Justin.

    Reply
  81. David Alexander
    David Alexander January 31, 2011 at 11:41 am |

    Hey Justin, I came up against something.

    So I was having good results with more complex conditional versions of what you are doing with several scripts and creating a tree for a string of pages etc, the issue was this though, I was controlling certain scripts to work on the front end on certain pages, but then found the plugins didn’t have the functionality on the back on (dashboard) of wordpress, I was wondering if there is a smart way to still load the scripts you need inside the dashboard independently from the front end of whether its something only needed on is_single etc?

    Cheers man.

    Reply
  82. Speed Up and Optimize Your WordPress Site
  83. Jeroen
    Jeroen April 4, 2011 at 10:49 am |

    Hello Justin

    Great article , i am only having one issue , is there a possibility to register a script on multiple pages something like :

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
    	if ( !is_page('contact' , 'events' , ) ) {
    		wp_deregister_script( 'contact-form-7' );
    	}
    }

    not sure about the :” if ( !is_page('contact' , 'events' , ) ) { ” rule

    hope you can help me

    Reply
  84. Ajay
    Ajay May 19, 2011 at 9:24 am |

    Simply amazing tutorial.

    I’m running out of ideas for speeding up wordpress and this will help me to improve perfromance further. I was wondering if there is any plugin which can take care of cleaning up CSS and JS files? I got over 100 blogs and it is certainly not feasible to add these changes to each of them manually.

    Reply
  85. tianyi
    tianyi May 23, 2011 at 3:38 am |

    Dear Justin and other guys,

    Firstly thank you for Can it be possible to use custom field to control loading css and js or not?

    I tried but failed.

    Best regards!

    Reply
  86. 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves
  87. Amy N Boon » 12 Lesser Known But Useful WordPress Hacks
  88. billboc
    billboc August 2, 2011 at 4:35 pm |

    hello

    for the “bad plugin” i tried:

    if ( !is_single() ) {
    remove_action('wp_print_styles', 'mfbfw_css'); }

    but it don’t work…
    any ideas ?
    thank you for help
    ++

    Billboc

    Reply
  89. 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves – Just a blog :)
  90. 10 Tips to Make Your WordPress Blog Outstanding - JustAnART
  91. How to remove WP Geo plugin from specific pages | | design is philosophydesign is philosophy
  92. Cyborg
    Cyborg November 30, 2011 at 11:05 pm |

    Wow I had actually deleted the wp-pagenavi.css and added the CSS to Main: style.css to speed up my pages. As well as I had disabled: “Use pagenavi-css.css” from wp-admin PageNavi menu. Every thing looks good so I never checked server logs. I was surprised when I checked my apache “error.log” today it was so big as 800MB in only 2 months!!!

    wp-pagenavi was reason for this mess and to get rid of that I found this article and I :
    1). Started to search for: wp_enqueue_style in wp-pagenavi.php unfortunalty I couldn’t find that word in this file or directory.

    2). Added this to my themes functions.php

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    
    function my_deregister_styles() {
    	wp_deregister_style( 'wp-pagenavi' );
    }

    3). I also tried to add: remove_action(‘wp-pagenavi’);
    to functions.php

    —-
    I tried this but my server was still showing same error.log growing :-(

    Finally I had to edit file: plugins/wp-pagenavi/core.php
    COMPLETLY REMOVE LINE NR 180, Looks ike:

    add_action( 'wp_print_styles', array( __CLASS__, 'stylesheets' ) );

    And the error is GONE :-)

    I wonder:
    1). How can I remove this action from themes functions.php instead of deleting line 180? It would be good to know since future updates for wp-pagenavi will put this line back again.

    2). How to achieve 100% performances? The best way is actually to delete line 180 in wp-pagenavi/core.php? It doesn’t make any sense to define this function/action on every page to server and then telling it again to “don’t use/remove” this function/action.

    You should remove every single byte which is useless if you are on a low budget server or are a professional developer to achieve and deliver BEST Performances.
    Bytes makes KB´s & KB´s makes MB´s.. so on..

    Thank you Justin for helping :-)

    Reply
  93. How to remove WP Geo plugin from specific pages | Creative Web Design Agency
  94. Matt
    Matt February 9, 2012 at 4:20 pm |

    Howdy,

    Just to say “thanks” worked brilliantly and was super handy in lightening a mobile version of the site

    Matt

    Reply
    1. Jesse
      Jesse February 17, 2012 at 4:08 am |

      You really got it to work? Im assuming you are on WP 3.3.1 ?

      Were you able to find the handle for plugins which DONT use enqueue?

      Any exact codes would be great

      Reply
  95. Devin Walker
    Devin Walker June 8, 2012 at 2:39 am |

    3-years later and still works like a champ!

    Reply
  96. Swapnil
    Swapnil June 26, 2012 at 2:28 am |

    Hey….this works well for wp_enqueue_style();
    but what if the plugin is using link tag?

    $extra_html =<<<TTT

    TTT;

    how should i disable this and add related css to my theme css??

    Reply
  97. Fabio
    Fabio August 7, 2012 at 5:44 pm |

    Hi Justin,

    Great, it works like a charm!

    Thank you!

    Reply
  98. Mark Wyner
    Mark Wyner August 28, 2012 at 7:36 pm |

    You are a champion, sir. Thank you.

    Reply
  99. Is there a way not to load a plugin when on low resolution? | question code
  100. Stitchapps
    Stitchapps December 24, 2012 at 10:11 am |

    Great tip to improve performance of WP sites. Thanks for sharing…

    Reply
  101. Lisa Thomas
    Lisa Thomas January 5, 2013 at 12:31 pm |

    I am part of a group of volunteers that is starting a new scheme in our community in Portland. One of the community projects that we are about to start relatates to your blog, and therefor some of the information here is of value for us and I just wanted so say thank you for that.

    Reply
  102. Site Speed Is Money – How I Earnt $30,587 In 6 Hours - Matthew Woodward
  103. Janelle
    Janelle February 3, 2013 at 4:34 pm |

    Hello!

    I am wondering about using this to cancel-out different scripts on different pages. Here’s what I have (which is not working);

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
    if ( !is_page('contact') ) {
    	wp_deregister_script( 'contact-form-7' );
         }
    if ( !is_page('calendar') ) {
    	wp_deregister_script( 'gigpress-admin-js' ); 
         }
    if ( !is_page('bios') ) {
    	wp_deregister_script( 'tabs-slides' ); 
        }
    }

    Can someone tell me – what is wrong here? What’s the problem? Thank you so much.

    Reply
    1. John
      John April 5, 2013 at 4:58 am |

      For GigPress JS, use “gigpress-js” instead of “gigpress-admin-js”. I haven’t figured out what to use for the css yet.

      Reply
  104. How To – 10 Tips To Give Your Blog a Top Quality Feel | DWH-UK.com : Great Themes at Sensibles Prices!
  105. wp enqueue style | 如意PHP
    wp enqueue style | 如意PHP May 20, 2013 at 3:48 am |
  106. Besiktas
    Besiktas May 20, 2013 at 1:11 pm |

    Thank you very much; that was very clear and helpful!

    Reply
  107. Besiktas
    Besiktas May 20, 2013 at 1:12 pm |

    @Janelle: Do you want to show those things in for example in your contact page or not? Because the ! mark means ‘ if NOT-contact page, then…. ‘

    Reply

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.