Marinus Klasen

Marinus Klasen

  • WordStress
  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

November 8, 2021

VS Code showing errors for functions in WordPress core?

Marinus Klasen

I literally got used to Visual Studio code highlighting function names from WordPress core when working in environments that don’t include the WordPress Core files. Quite disturbing actually – especially when you have code sniffers setup and follow WordPress Coding Standards.

Well, today I noticed it again and did some research. Apparently, there’s an easy fix!

The Easy Fix

When you have PHP Intelephense installed (and if you don’t have it, go get it), this is what you need to:

  1. Go to Preferences -> Settings
  2. Open Extensions -> Intelephense
  3. Scroll all the way down to “Stubs” (it’s a large list, can’t miss it)
  4. Click “Add Item”
  5. Press “W” for WordPress, or scroll down the list untill you find it.
  6. Select WordPress and click “OK”
  7. Close your settings

That’s it!

Happy developing!

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

Looking for a WordPress expert?
Hire top notch developers on Codeable!

Consult an expert

Comments

  1. Chandan says

    October 1, 2022 at 2:05 pm

    Do you mean ‘Stubs’, on line 3?

    Reply
    • Marinus Klasen says

      October 1, 2022 at 6:35 pm

      I’ll have to double check next Monday. Unless.. can you confirm it says Stubs?

      Reply
      • Kevin says

        January 28, 2023 at 4:35 am

        It’s definitely stubs and not subs… and you came up 3rd for me when I searched how to fix this… Also, it sort of works for me, all the red errors are gone but they are now replaced with orange warnings… any idea how to solve that?

        Reply
        • Marinus Klasen says

          February 3, 2023 at 12:29 pm

          Thanks, I corrected it now! Hmm, not sure about the orange warnings, can you share some more information?

          Reply
        • Shuvro says

          January 9, 2025 at 7:10 pm

          Hey Kevin, it’s probably because you have other extensions enabled such as PHP by Devsense. Uninstall or disable the plugin and it will work fine.

          Reply
  2. Martin says

    February 13, 2023 at 11:22 am

    It worked 100% fine for me 🙂 thanks

    Reply
  3. Joel says

    March 7, 2023 at 11:40 pm

    Thanks man,

    Just getting started with wordpress and all these warnings were really annoying.

    Reply
    • Marinus Klasen says

      March 22, 2023 at 12:47 pm

      I can imagine, have fun in WordPress development!

      Reply
  4. jjeedev says

    July 27, 2023 at 7:52 pm

    That worked for me! Thank you!

    Reply
  5. Jörg says

    August 17, 2023 at 1:54 pm

    Klasse, ich habe lange nach einer so einfachen Erklärung/Anleitung gesucht. Funktioniert einwandfrei. Danke dafür

    Reply
    • Marinus Klasen says

      August 17, 2023 at 2:11 pm

      Graag gedaan!

      Reply
  6. Paolo says

    October 28, 2024 at 6:02 pm

    Thank you, Sir!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get in touch

Contact me using the details below

Marinus Klasen

Wilhelmina van Pruisenweg 35, 2595 AN Den Haag

marinus@mklasen.com
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Elementor Widget UsageMarch 27, 2025
  • Programmatically showing popups with ElementorMarch 25, 2025
  • The Elementor sanitize_settings errorSeptember 12, 2024
  • Announcing.. Wooping Shop Health!June 13, 2024
  • Swiper setup when using wp-scriptsMarch 14, 2024

Copyright © 2025 · Marinus Klasen | Webdesign by Team Rood