markomiljanovic
Forum Replies Created
-
Hi @jennifer254,
WPCode outputs your snippet code exactly as you paste it, so we don’t automatically add async or defer to script tags. If you’d like a script to load asynchronously, you’ll want to add async or defer directly to the tag yourself, like <script async src=”https://example.com/pixel.js“></script>.
One thing worth mentioning, for external scripts where you want to control attributes like async or defer, you’ll want to use an HTML snippet rather than a JavaScript snippet. JavaScript snippets are automatically wrapped in <script> tags at execution time, so you can’t set attributes on that tag yourself. With an HTML snippet, you can include the full <script> tag and any attributes you need.
Let me know if I can provide more info!
Thanks,
Hi @hommealone,
Thanks for the suggestion, I’ll pass it along to the team.
The process is identical in both editors, which is probably why we haven’t highlighted it separately. Each snippet you create in WPCode gets a shortcode like [wpcode id=”123″], and you just paste that shortcode into the page wherever you want it to appear, into a Shortcode block in the block editor, or directly into the content in the classic editor. Same steps either way.
You can also skip the manual step entirely with Auto Insert, which places the snippet automatically based on a location you pick (header, footer, before/after content, etc.). More on both approaches here: https://wpcode.com/docs/a-complete-guide-to-snippet-locations/.
Let me know if I can provide more info!
Thanks,
Hi @ramon302,
WPCode outputs your snippet code exactly as you paste it, so we don’t automatically add async or defer to script tags. If you’d like a script to load asynchronously, you’ll want to add async or defer directly to the tag yourself, like <script async src=”https://example.com/pixel.js“></script>.
Let me know if I can provide more info!
Thanks,
Hi @darlen3,
Good news, dark mode is already built in. You’ll find the toggle under WPCode > Settings in your WordPress admin. Just scroll down to the “Dark Mode” option, switch it on, and save changes.
From that point on, the code editor will use a darker theme across all your snippets and the Headers & Footers screen.
Thanks,
Hi @tammy65,
Yes, you can absolutely do this with the free version. WPCode’s Smart Conditional Logic includes a page type rule that lets you target the homepage specifically.
So for your widget script, you’d create the snippet as usual, then under the Smart Conditional Logic section toggle “Enable Logic” on and add a rule to target the front page only.
For reference, please check the following screenshot: https://quicksnip.com/s/cjfp112tsm55hds
Let me know if you run into any issues setting it up.
Thanks,
Hi @zane97,
Thank you!
No limit at all, you can add as many snippets as you’d like in the free version, with no cap on how many you create or keep active. All snippets are stored locally on your own site, so it’s entirely up to
you how many you want to build up over time.Let me know if you have any other questions.
Thanks,
Hi @zane97,
Thanks for the kind words!
With the free version, saving your own custom snippets to a personal collection isn’t possible.
This is available in WPCode Pro, which includes a feature called My Library: once your site is connected to your WPCode account, you can save any custom snippet to your personal cloud library and deploy it on your other connected sites with a single click. This feature is available in any subscription plan.
That said, the free version does include export/import for snippets, so you
can easily move them between sites or keep local backups by exporting from one site and importing on another.Let me know if you have any other questions.
Thanks,
- This reply was modified 2 weeks, 2 days ago by markomiljanovic.
Thanks for reaching out and glad you’re enjoying WPCode!
Unfortunately, “Device Type” (loading a snippet on mobile, tablet or desktop screen) is a Pro-only feature, so it isn’t available in the free version.
If you can share a bit more about what you’re trying to achieve and the snippet you’d like to load only on mobile, we might be able to suggest a solution.
Thanks,
Hi @mariel442,
It really depends on what the source recommends, so I’d suggest checking their instructions and placing the code wherever they specify. In general, though, there’s no real benefit to using one over the other for a small verification code.
Most verification providers (Google Search Console, Bing, Pinterest, etc.) specifically ask for the code to be placed in the section, in which case you’d want to use the Header field.
Let me know if I can provide more info!
Thanks,
Hi @karlykaiom,
Use the Header field for code that needs to load before the closing tag. The Footer field will output the script closer to the closing body tag.
Thanks,
Hi @pineapplepalm,
WPCode does not use JSONP. If you see
rest_jsonp_enabledwhen searching the codebase, that’s simply a WordPress hook name included in our Hooks Generator list (a label used in a dropdown), not something WPCode depends on at runtime. Disabling JSONP on your site will not affect WPCode.WPCode does not currently include a built-in option (similar to
DISALLOW_FILE_MODS) to lock snippet creation and editing across the board. This can be achieved with custom code, so please contact us and we’ll help you set it up: https://wpcode.com/contact.Thanks,
Hi @aysia00,
The plugin needs to stay active for the code to keep running on your site. WPCode doesn’t modify your The plugin needs to remain active for the code to keep running on your site. WPCode doesn’t modify your theme files or permanently add the verification code to your site’s HTML. Instead, it adds the code dynamically through WordPress hooks each time a page loads. That’s why it works without you needing to edit theme files, and it also means that if the plugin is deactivated, the code will stop being added and the verification code will no longer appear in your site’s source.
Thanks,
Hi @braedenmayer,
The best way to do this is to move the script into its own snippet since Header & Footer always loads site-wide. You’d create a new snippet at Code Snippets > + Add Snippet, and choose HTML as the code type so it outputs exactly as-is and paste the tracking script in.
Under Insertion, set the Auto Insert location to “Site Wide Header“. Then scroll down to Smart Conditional Logic, toggle it on, set the conditional logic type to “Show,” and add a rule group matching the pages you want, for reference, please check the following screenshot: https://quicksnip.com/s/wk86t3s90t2f12k.
Once saved and activated, the snippet will only output in the header on the pages matching your rules, and nowhere else. You can find a full walkthrough here: https://wpcode.com/how-to-add-scripts-to-specific-pages-in-wordpress/
Let me know if you run into any issues setting it up.
Thanks,Hi @pbaddock,
The missing
activeproperty in the cached data is a real finding, and we’ll look into it, but it isn’t what’s causing your symptom. Nothing on theRun Everywhereruntime path callsis_active(), so cache-loaded snippets execute regardless of what it returns.The likely culprit is that all
Run EverywherePHP snippets are concatenated and passed to a singleeval(). A closing?>in any earlier snippet or an unclosed/* */comment will cause every subsequent snippet in the batch to silently not execute. Your mu-plugin works around it because it evals each snippet separately.It is worth checking your active
Run Everywheresnippets for a trailing?>or an unterminated/* */comment. To narrow it down quickly, you can use the search bar on the Code Snippets list to search for?>and/*. That should surface the candidates in a few seconds.
Thanks,Are you adding this code as a code snippet or through a dedicated Header & Footer area in the plugin? For reference, please check the following screenshot: https://a.supportally.com/i/LPoxtW? If it’s a snippet, is it saved and activated, and does it show as “Active” in your snippets list, like it’s shown on the screenshot: https://a.supportally.com/i/p7yAgU?
If that all checks out, the next most common cause is caching. If you’re using a caching plugin, a CDN, or your host has server-level caching enabled, please purge/clear all caches and then hard refresh the page (or test in an incognito/private window) to see if the change appears on the frontend.
Thanks,