How to Remove PageFly Leftover Code from Your Shopify Theme
PageFly adds more to a theme than most apps: its own layout file, a set of pagefly snippets, and pf- sections and snippets for the pages you published with it. Uninstalling PageFly does not remove any of them.
The most common leftover we see is snippets/pagefly-main-js.liquid still reading pagefly.measurementId, a value that no longer exists once the app is gone.
What PageFly leaves behind
Across roughly 170 Shopify stores scanned with Store Health, about 1 in 9 still had PageFly code reading data that no longer existed.
Theme files
snippets/pagefly-main-js.liquid: PageFly's main script snippet. The most common leftover.layout/theme.pagefly.liquid: A separate layout used by PageFly pages.snippets/pagefly-app-header.liquid, snippets/pagefly-head.liquid: Header and head includes.snippets/pagefly-main-css.liquid, snippets/pagefly-settings.liquid: Styles and settings.sections/pagefly-section.liquid: A wrapper section.sections/pf-<id>.liquid, snippets/pf-<id>.liquid, snippets/pf-<id>-css.liquid: One set per published PageFly page. The <id> part differs per page.
Metafields the theme still reads
These keys are read by theme code, but no data exists for them once the app is gone.
pagefly.measurementIdin snippets/pagefly-main-js.liquidpagefly.html_metain PageFly page templatespagefly.globalSettingin PageFly snippets
Metafields the app stores
Data PageFly may keep in your store after uninstall. It is harmless once no theme code reads it.
shop: pagefly.acceptTracking, pagefly.globalSettingpage: pagefly.html_meta
Script hosts
Script tags in theme files that load from:
cdn.pagefly.io
How to remove PageFly code manually
Check first: Before you remove anything, list which pages still use the PageFly layout or pf- sections. Those pages were built in PageFly and will be blank without it, so rebuild or unpublish them first.
- Duplicate your live theme. In Online Store > Themes, choose Duplicate on the live theme and do all of the work below on the copy.
- Turn off the app embed, if there is one. In the theme editor, open Theme settings > App embeds and switch off anything from PageFly. Remove any PageFly app blocks from your templates too.
- Search the code. Open Edit code and search for
pagefly,pf-. Write down every file that matches. - Remove references before files. Delete the
{% render %}and{% include %}lines that load PageFly snippets, and any code that reads the metafields listed above. Start withlayout/theme.liquid, then templates, sections, and snippets. - Delete the files. Once nothing renders them, delete the PageFly snippets, sections, and layouts. If you are unsure about a file, leave it for now. An unused file costs nothing.
- Test the duplicate. Preview every page that used a PageFly layout, plus the home page and a product page, on desktop and mobile. Check the browser console for errors.
- Publish and recheck. Publish the cleaned theme during a quiet hour and keep the old one as a backup until you are sure everything works.
Watch out: Deleting layout/theme.pagefly.liquid while a page template still points to it will break that page. Switch those pages to your normal template first.
Faster: let Store Health find it
Store Health scans your theme, scripts, and metafields in one read-only pass. It shows script tags and renders of missing snippets with their file and line number, and lists metafields your theme reads that hold no data. Nothing is changed in your store.
FAQ
Will my PageFly pages still work after I uninstall?
Usually not as designed. Their content was built in PageFly. Rebuild the pages with your theme's sections or unpublish them before cleaning up the code.
What is layout/theme.pagefly.liquid?
A separate theme layout that PageFly pages render inside. Once no page uses it, you can delete it.
There are dozens of pf- files. Do I delete them all?
Each pf- section and snippet belongs to one PageFly page. Remove the ones for pages you no longer use. If none remain, all of them can go once nothing renders them.