# How to remove an enqueued script that I can't find on any of my pages from functions.php? / How to edit functions.php?

**URL:** <https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775>\
**Category:** Questions\
**Tags:** wordpress\
**Created:** [March 13, 2024, 12:54pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775 "2024-03-13T12:54:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 13, 2024, 12:54pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/1 "2024-03-13T12:54:52Z")

</div>

I think I’m going crazy. I have a script in the footer that looks like this  
`<script type="text/javascript" id="inline-script-1-js-after">`. Inside, there’s some JS code. I actually used that JS code before on one page, but it’s been deleted and I can’t find it anywhere on the site, but it’s still in the footer.

Is it possible that Pinegrow somehow automatically adds it? I’m not using any Code Snippet plugin.

I’m 99.99% sure that I’m the problem here, but I simply can’t find this code anywhere.

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [March 13, 2024, 3:36pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/2 "2024-03-13T15:36:24Z")

</div>

I’ve never seen Pinegrow add anything like that. Can you share a page that has it?

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [March 13, 2024, 5:22pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/3 "2024-03-13T17:22:33Z")

</div>

It looks like it’s added by Pinegrow interactions; I just didn’t recognize it…

```auto
wp_register_script( 'inline-script-1', '', [], '0.0.90', false );
    wp_enqueue_script( 'inline-script-1' );
    wp_add_inline_script( 'inline-script-1', '/* Pinegrow Interactions, do not remove */ (function () {
                try {
                    if (!document.documentElement.hasAttribute("data-pg-ia-disabled")) {
                        window.pgia_small_mq = typeof pgia_small_mq == "string" ? pgia_small_mq : "(max-width:767px)";
                        window.pgia_large_mq = typeof pgia_large_mq == "string" ? pgia_large_mq : "(min-width:768px)";
                        var style = document.createElement("style");
                        var pgcss = \'html:not(.pg-ia-no-preview) [data-pg-ia-hide=""] {opacity:0;visibility:hidden;}html:not(.pg-ia-no-preview) [data-pg-ia-show=""] {opacity:1;visibility:visible;display:block;}\';
                        if (document.documentElement.hasAttribute("data-pg-id") && document.documentElement.hasAttribute("data-pg-mobile")) {
                            pgia_small_mq = "(min-width:0)";
                            pgia_large_mq = "(min-width:99999px)";
                        }
                        pgcss += "@media " + pgia_small_mq + \'{ html:not(.pg-ia-no-preview) [data-pg-ia-hide="mobile"] {opacity:0;visibility:hidden;}html:not(.pg-ia-no-preview) [data-pg-ia-show="mobile"] {opacity:1;visibility:visible;display:block;}}\';
                        pgcss += "@media " + pgia_large_mq + \'{html:not(.pg-ia-no-preview) [data-pg-ia-hide="desktop"] {opacity:0;visibility:hidden;}html:not(.pg-ia-no-preview) [data-pg-ia-show="desktop"] {opacity:1;visibility:visible;display:block;}}\';
                        style.innerHTML = pgcss;
                        document.querySelector("head").appendChild(style);
                    }
                } catch (e) {
                    console && console.log(e);
                }
            })();');

```

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 13, 2024, 6:00pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/4 "2024-03-13T18:00:15Z")

</div>

@matjaz It turns out that the script is enqueued by Pinegrow in functions.php, but I don’t remember enqueuing anything. I used the code on one page inside `<script>` tags, but then it was deleted. Is there a way to somehow remove it from functions.php? Regenerating it didn’t help.

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [March 14, 2024, 1:36pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/5 "2024-03-14T13:36:45Z")

</div>

To add to this, Adryan is running the WordPress plugin. The desktop version doesn’t enqueue it unless you activate Interactions, but I suspect the plugin works a bit differently.

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 14, 2024, 2:21pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/6 "2024-03-14T14:21:51Z")

</div>

I’d like to clarify that the script doesn’t come from Interactions. The enqueued JS code was created by me, but it was only used inside `<script>` tags on a page and later deleted. Now the script is nowhere to be found, so I can’t remove the “enqueue” action.

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [March 14, 2024, 2:29pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/7 "2024-03-14T14:29:23Z")

</div>

Does “Clear the theme folder” and re-exporting with “Export the theme” help?

Here’s a screenshot from our docs.

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/8/8065cd6c86d6d631a6478d1bb9ed0b6308df0e2c.png)

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 14, 2024, 2:32pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/8 "2024-03-14T14:32:17Z")

</div>

I’m using the WP plugin.

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [March 14, 2024, 2:33pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/9 "2024-03-14T14:33:05Z")

</div>

Ohh yeah, Im guessing the menu options will be different for plugin, for eg, “Export the plugin”.

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [March 14, 2024, 2:33pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/10 "2024-03-14T14:33:56Z")

</div>

Ahh my apologies, you are not using the desktop app, rather Pinegrow wp plugin

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 14, 2024, 2:34pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/11 "2024-03-14T14:34:31Z")

</div>

Oh yeah, I exported the theme multiple times. I also tried to edit the functions.php file, but it gets reverted on each export.

---

<div class="post-metadata">

**Author:** ![TechAkayy](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@TechAkayy](https://forum.pinegrow.com/u/TechAkayy)\
**Post date:** [March 14, 2024, 2:51pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/12 "2024-03-14T14:51:00Z")

</div>

Inline script tags (our own or automatically injected when activating interactions on the page), when exported, are automatically enqueued and added as inline script (in the desktop app, wondering if it’s different with wp plugin).

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/c/cdd3dd080042f42af486eeb0576b26e274ca79e7.png)

So, in your case, if you removed that `<script type="text/javascript" id="inline-script-1-js-after">` tag from your page, then it should also be removed off the `functions.php` automatically, which doesn’t seems to. Did I understand this correctly?

The easiest way to fix this in the desktop app, is to clear the current theme/plugin folder PLUS also delete the local `_pgexport` folder, and do a fresh export.

![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/6/6d06ce12bbc26769a5955f5326516ebfba5a1be7.png)

I’m not sure about how to achieve the same in WP plugin, will probably wait for someone from the community to advise.

That said, the export should automatically add and remove inline-scripts, without the need to delete \_pgexport, clear and re-export the theme/plugin. But, I will probably wait for WP pros in the community to confirm this.

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 14, 2024, 3:39pm UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/13 "2024-03-14T15:39:05Z")

</div>

I don’t see any way to do it in the WP plugin. I guess I have to wait for an email reply from support.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [March 15, 2024, 7:05am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/14 "2024-03-15T07:05:49Z")

</div>

@adamslowe

> [@adamslowe](#):
>
> To add to this, Adryan is running the WordPress plugin.

Based on what I observe, the situation is more intricate. The project was initially developed using the desktop version and then transferred to the plugin.

@Adryan  
Ongoing investigations.  
Based on my initial findings, it may be beneficial to review/adjust (remove the unwanted things) the original project from Pinegrow desktop, then reimport it - as a new project - into the plugin with the necessary modifications.

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 15, 2024, 7:19am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/15 "2024-03-15T07:19:23Z")

</div>

I don’t think I ever used the desktop version for this project, though. I don’t have the Tailwind extension in the desktop version.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [March 15, 2024, 7:22am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/16 "2024-03-15T07:22:32Z")

</div>

Then I’m deeply sorry if my first impression was wrong but was the project fully created within the plugin or did you import an existing HTML template to start the project?

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 15, 2024, 7:24am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/17 "2024-03-15T07:24:55Z")

</div>

I created it from scratch in Pinegrow plugin. It generated the boilerplate HTML code and then I pasted some Tailwind CSS sections.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/emmanuel/32/6294_2.png) [@Emmanuel](https://forum.pinegrow.com/u/Emmanuel)\
**Post date:** [March 15, 2024, 7:27am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/18 "2024-03-15T07:27:09Z")

</div>

Then I guess I was misled by the apparent complexity of the template content. Please accept my apologies for the initial (early morning) misunderstanding.

I will continue my investigations 😉

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 15, 2024, 7:28am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/19 "2024-03-15T07:28:43Z")

</div>

No worries, I appreciate you taking the time to help 🙂

---

<div class="post-metadata">

**Author:** ![Adryan](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Adryan](https://forum.pinegrow.com/u/Adryan)\
**Post date:** [March 15, 2024, 8:14am UTC](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775/20 "2024-03-15T08:14:15Z")

</div>

SOLVED. Cause of the “bug” - the idiot behind the keyboard 😉

[Next page](https://forum.pinegrow.com/t/how-to-remove-an-enqueued-script-that-i-cant-find-on-any-of-my-pages-from-functions-php-how-to-edit-functions-php/8775.md?page=2)
