Support » Fixing WordPress » WP 4.5 and jQuery Syntax Error

  • Hi,

    So we’ve just updated to 4.5 and we seem to be receiving a syntax error with jQuery which has completely stripped the website of its navigation bar, among other things.

    I’ve read around that it’s likely caused by a plugin placing jQuery in the footer, but to my knowledge we’ve not got a plugin of that nature installed on the website. I’m a little lost with this and am hoping somebody might know what’s caused this problem.

    The error we’re receiving is:

    Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])

    and the URL is

    If anyone could point me in the right direction I’d be grateful. Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • I’m getting the same error…

    I think it’s possibly because it’s updated the bundled jQuery version from 1.11.3 to 1.12.2

    Might be worth disabling the bundled version an using a standalone version with your theme

    That worked perfectly, thank you!

    Do you think this is something that will likely get rectified as WordPress become aware of the issue?

    Moderator Marius L. J.



    This is not a WordPress problem, but a theme or plugin incorrectly using JavaScript code, the newer versions of jQuery are just better at detecting incorrect code and erroring out about it.

    It is highly recommended -not- to override the core jQuery version as plugins and themes rely on this to be a known value.

    Unfortunately it’s hard for us to pinpoint if it’s a theme or plugin causing the problem if you’ve already overwritten the jQuery versions.

    Perfect Buddy!! Thanks for the code.


    Thank you Marius, I think I follow.

    So it’s more likely a result of a plugin or theme having been unprepared for the 4.5 update?

    I suspect it has a lot to do with our theme (Divi) needing an update. We’re waiting on authorisation to upgrade it. I’ll remove the above code when the theme is updated and hopefully that will fix the issue properly.

    Moderator Marius L. J.


    Divi is known to be incompatible, yes, our Master List ( contains a fix for this that does not break Core jQuery though.

    George Stephanis


    Code Monkey

    If you’re at all familiar with the command line, this ack command will pinpoint the malformed code:

    ack "\[href.?=#"

    Just run that at the root of your site via ssh and it’ll find the problems to correct.

    That’s brilliant, thank you very much!

    I’ve stripped out the code above from the functions file and altered the offending line in the custom.js file and it works perfectly.

    Hi Guys,

    I am busy building a website on a temporary domain with a theme called Avada. I made some progress yesterday and today my site wont load at all. Not when I “preview site”, not when I “visit site” nor when I just follow my domain.

    Is this what you guys are experiencing too?

    Here is my domain:

    Would love to get your insights. Thanks

    Moderator Mark Ratledge


    Forum Moderator

    @therous: your issue is completely different and unrelated; start your own thread.

    But first, realize that Avada is a premium theme not supported in these forums. You need to go to the site where you bought the theme for help. These forums are for free themes available in the WordPress theme directory at See

    Thanks Mark, I am new to wordpress and still finding my feet in the community. I did see something that looks closer like my issue on an Avada forum.

    Appreciate the reply


    Hi I am having a similar problem and not sure what to do. Can someone please help me? Both my simple tooltip plugin and accordion feature aren’t working. What should I do?

    Moderator Mark Ratledge


    Forum Moderator

    @tgindustriesadmin: Read for the jQuery 1.12 fix:

    And, you’re using a premium/paid theme. It’s best to go to the support site where you bought the theme for help with customizations and issues. You paid for support when you bought the theme, so you should contact the people who sold you the theme. These forums are for free themes available in the WordPress theme directory at See

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘WP 4.5 and jQuery Syntax Error’ is closed to new replies.