Title: Uncaught TypeError: $ is not a function
Last modified: September 17, 2020

---

# Uncaught TypeError: $ is not a function

 *  [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/)
 * Everytime I activate autoptimize I get this in my console
 * Uncaught TypeError: $ is not a function
 *  jQuery(document).on(‘click’, ‘input[type=”checkbox”][name*=”app_candidate_sel”]’,
   function () {
    var checked_box_count = jQuery(‘input[type=”checkbox”][name*=”
   app_candidate_sel”]:checked’).length; if (checked_box_count > 0) { jQuery(“#jobsearch-
   export-pdf”).show(); } else { jQuery(“#jobsearch-export-pdf”).hide(); } });</
   script> <script type=”text/javascript”>$(document).ready(function () { ‘use strict’;
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-typeerror-is-not-a-function-9%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/page/2/?output_format=md)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420819)
 * That sounds like you don’t have `js/jquery/jquery.js` in the JS optimization 
   exclusion list any more Andrew? Can you re-add it and test again?
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420840)
 * Exclude scripts from Autoptimize: wp-includes/js/dist/, wp-includes/js/tinymce/,
   js/jquery/jquery.js
 * I have that in the exclusion list
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420849)
 * you can check the console on the website I have the plugin activated
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420850)
 * hmmm … do you have a non-production site where you could leave things broken 
   for a while for me to investigate tomorrow (off to bed now, almost 10 in the 
   evening here)?
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420870)
 * no I don’t let see if I can clone the site
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13420872)
 * disable “aggregate JS” for now to have your site running normally, I’ll look 
   into the errors (below) I’m seeing tomorrow.
 * [[
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13421039)
 * ok thank you
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13421076)
 * i disabled the “aggregate JS” and my custom fonts aren’t showing.. I will enable
   aggregate later tonight so you can take a look at it.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13422038)
 * that’s likely CSS optimization configuration that needs tweaking, there as well
   you can probably untick “aggregate CSS” as a temp workaround.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13422069)
 * OK, so re. `$ is not a function`; the root problem here is that [in WordPress jQuery should be used in “compatibility mode”](https://premium.wpmudev.org/blog/adding-jquery-scripts-wordpress/),
   where instead of `$(<your original code here>)` one should use `jQuery(<your 
   original code here>)` OR the code should be wrapped like this;
 *     ```
       (function($) { 
       $(<your original code here>)
       })( jQuery );
       ```
   
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13425398)
 * and this is in functions php?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13425528)
 * no, that is a change you should make the the level of the component (theme/ plugin)
   that is adding the inline JS (probably careerfy theme, but I see there also is
   a careerfy plugin).
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13425593)
 * > [View post on imgur.com](https://imgur.com/WonTYLf)
 * I’m in the careerfy folder which file should I be looking for?
    -  This reply was modified 5 years, 8 months ago by [andrewtronn](https://wordpress.org/support/users/andrewtronn/).
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13425606)
 * given it’s inline JS, it’s in a PHP-file, but can’t say which one I’m afraid.
   my opinion; this is a bug in careerfy, which is premium, maybe reach out to their
   support?
 *  Thread Starter [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * (@andrewtronn)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/#post-13425652)
 * so im in the careerfy > js > functions.php. Is this what I’m looking for
 * > [View post on imgur.com](https://imgur.com/d41KY5H)

Viewing 15 replies - 1 through 15 (of 27 total)

1 [2](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/page/2/?output_format=md)

The topic ‘Uncaught TypeError: $ is not a function’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 27 replies
 * 2 participants
 * Last reply from: [andrewtronn](https://wordpress.org/support/users/andrewtronn/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-is-not-a-function-9/page/2/#post-13435485)
 * Status: not resolved