WPCode Logo

WPCode Documentation

Documentation, Reference Materials, and Tutorials for WPCode

Most Popular

Get free tips and resources right in your inbox, along with 500+ others

Follow Us

How to find where a script or code is coming from in WPCode

Would you like to see exactly which snippets and scripts WPCode is putting on a page of your site?

In this guide, we’ll walk you through the WPCode menu in your WordPress admin bar. It lists everything WPCode loaded on the page you are viewing and links straight to the place each one is managed. All you need is a page on your site and a few seconds.

Before you get started, make sure WPCode is installed and activated on your WordPress site.

Turning On the WPCode Admin Bar Menu

To get started, we’ll confirm the WPCode menu is switched on.

WPCode adds its own item to the WordPress admin bar. That item is where the list of loaded code lives. WPCode switches it on the moment you activate the plugin.

It is still worth knowing where the switch is, because it is also how you tuck the menu away again.

From your WordPress admin sidebar, go to Code Snippets » Settings.

The WPCode settings screen with the Code Snippets submenu shown in the sidebar and Settings highlighted

The General Settings tab opens first. On this panel, scroll down to the Admin Bar Info row. Its toggle is blue when the menu is switched on.

The Admin Bar Info row on the WPCode General Settings panel, with an arrow pointing at its toggle in the enabled position

If you ever change this toggle, the panel keeps a save button at the very bottom. Once the toggle reads the way you want it, click Save Changes.

The Save Changes button at the bottom of the WPCode General Settings panel, with an arrow pointing at it

With the toggle on, the WPCode item is ready and waiting in your admin bar.

Finding the WPCode Menu on Your Site

The menu gathers its list while a page is being built. That means you read it on the front end of your site rather than in the admin.

Next, open any page of your site in your browser while you are still signed in to WordPress.

Note: The admin bar appears on the front end for signed-in users who have Show Toolbar when viewing site ticked on their WordPress profile. WordPress ticks it by default.

In the admin bar across the top, look for the WPCode item.

The WordPress admin bar on the front end of a site, with an arrow pointing at the WPCode item

Hover over it and the menu opens. WPCode’s own documentation calls this the Code Spotter menu.

Under the heading Loaded on this page, the menu is laid out in three parts. Each part carries a count. At a glance, you can see where the code on this page came from.

The open WPCode admin bar menu showing Loaded on this page, Global Scripts, Code Snippets, and Page Scripts, above the Add Snippet, Settings, Logs, and Help Docs shortcuts

Below the divider sit a handful of shortcuts, which stay the same on every page.

  • + Add Snippet takes you to the screen for creating a new snippet.
  • Settings returns you to the panel you were just on.
  • Logs opens WPCode’s record of snippet activity. It joins the menu once error logging is switched on.
  • Help Docs opens the WPCode documentation in a new tab.

Everything above the divider is a link. Every link lands on the screen where that piece of code is managed.

That is what makes the menu worth opening. You get from “something is loading here” to the exact field holding it in one or two clicks.

Reading the Global Scripts Count

The first part of the menu covers the code you have pasted into WPCode’s global header, body, and footer areas. That code goes on every page of your site, which makes it the first place to look. Hover over Global Scripts to open it.

The Global Scripts section of the WPCode admin bar menu expanded to show Global Header, Global Body, and Global Footer, each marked with a count of 1

Each of the three areas is listed with its own number. That number is 1 when the area has code in it and 0 when the area is empty.

The count beside Global Scripts tells you how many of the three areas are in use. Selecting any of the three opens the Header & Footer screen at that area, ready to read.

Seeing Which Snippets Ran on the Page

The second part lists the snippets that actually produced something on this page. WPCode builds it while the page loads rather than from your snippet list, which leaves out any snippet held back by its conditional logic. Hover over Code Snippets to open it.

The Code Snippets section of the WPCode admin bar menu expanded to show two auto-insert locations, Run Everywhere and Site Wide Header, each with a count of 1

Snippets are grouped by the auto-insert location that put them on the page, with the number of snippets in each group beside the name. Grouping them this way answers a second question along with the first: not only which snippets ran, but where in the page they were inserted. Selecting a location name opens your snippet list filtered to that location.

The count beside Code Snippets is those group numbers added together. It tells you how many snippets ran on this page in total.

Next, hover over a location name to see the snippets themselves. Each one is named. Selecting a name opens that snippet in the code editor.

A location in the WPCode admin bar menu expanded to show the name of the snippet that ran there, with an arrow pointing at the snippet name

Conversion pixels appear in this list too, alongside your snippets and under whichever location they use. Selecting one of those opens its tab on the Conversion Pixels screen instead of the code editor. That is where a pixel is set up.

Checking the Scripts Set on One Page

Note: The Page Scripts part of the menu comes with the paid version of WPCode.

The third part covers code attached to the single page you are viewing, rather than to the whole site. Hover over Page Scripts to open it.

The Page Scripts section of the WPCode admin bar menu expanded to show Header, Body, and Footer for the current page, each with a count of 0

The same three areas are listed, counted the same way. Each shows 1 where that area of this page has code of its own, and 0 where it does not.

A page that has never been given its own scripts reads 0 across all three, which is a useful thing to confirm. Selecting one of them opens this page in the WordPress editor with WPCode’s own panel already open at that area.

If the page also has snippets attached to it directly, a Custom Code Snippets entry joins the three areas. Those snippets are grouped by location and named the same way as the site-wide snippets above.

That’s it! You can now open any page of your site and read back everything WPCode put on it. Next, our guide on snippet locations explains the location names the menu groups your snippets under.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about the WPCode menu in the admin bar.

Who can see the WPCode menu in my admin bar?

Signed-in users who are allowed to activate snippets in WPCode. When you activate the plugin, WPCode gives that permission to every role that can already manage your site’s options. In a standard WordPress install, that means administrators. Your visitors never see the menu. Neither does anyone browsing your site signed out. See WPBeginner’s Beginner’s Guide to WordPress User Roles and Permissions for what each of the default roles can do.

Does the menu show the same thing on every page?

No, and that is the point of it. Code Snippets is rebuilt from the snippets that produced output while that particular page loaded. Page Scripts reads the scripts belonging to the page you are on. Only Global Scripts reports the same three areas everywhere, because that code goes on every page.

They tell you whether the area is in use, not how many separate scripts you put in it. Each area shows 1 when it holds any code at all and 0 when it is empty. The count next to Global Scripts is those three numbers added together. That means it goes as high as 3.

Does the menu appear inside the WordPress admin too?

Yes, and there it carries Code Snippets and the same shortcuts. Global Scripts and Page Scripts are front-end only. Your global code is not loaded on admin screens. Page Scripts describes a page a visitor is viewing. To see all three parts, open a page of your site.

What happens if a page turns off the global scripts?

The menu says so in place of the count. When a page switches off the global header, body, or footer for itself, that area is listed as Disabled via Page Scripts. That way you can tell an empty area apart from one that has been set aside for this page.

Where does a snippet name in the menu take me?

Straight into that snippet in the WPCode code editor, with the code and its settings in front of you. Conversion pixels are the one exception: they open on the Conversion Pixels screen, on the tab for the pixel you selected.

Still stuck? How can we help?

Last Updated on

Get Started Today & Add Your Own Snippets

Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.