Unable to Edit Theme Files in Shopify Embedded App (write_themes Scope Added)

Hi Shopify Partner Support Team,

We’re currently developing a Shopify embedded partner app using App Bridge, without relying on the Shopify CLI extensions.

During app installation, we selected the required write_theme_code, read_themes, write_themes scope to allow theme file editing. However, we’re encountering an issue where our app is unable to edit any theme files through API, even though the permission is granted we are getting permission issues.

Could you please guide us on how to properly enable or access theme file editing functionality within an embedded app (built without CLI extensions)?
Are there any additional scopes, API endpoints, or configuration steps required to make this work?

Thank you for your time and support.

Best regards,
Shivraj
Simplileap Digital LLP

Hi there!

In order to make edits to theme files, you require an exemption from us. There is more information on this here:

Our recommended solution for making changes to themes is through Theme App Extensions. Theme App Extensions do not require an exemption from us, and are designed to add theme functionality without touching a merchant’s theme. You can read more about Theme App Extensions here:

Please note that if you intend to make your app public and available on the App Store, then it can only use Theme App Extensions to make changes to themes.

We have already build a app using App Bridge, without relying on the Shopify CLI extensions, So in that case can i use Theme App Extensions?

Yes, you can use theme app extensions :slight_smile:

Out of curiosity, can you share why you’re not using Shopify CLI?
It’s a Command Line tool that can generate the theme app extension template for you and allow you to preview it as you develop.

Yes we have started using theme app extensions in the existing Shopify embedded partner app using (App Bridge, without relying on the Shopify CLI extensions).

But the problem is we are still getting this kind of error during write themes

**Error:-
ERROR :collision:: Error: Theme file modification requires an exemption from Shopify. The REST API endpoint is not available without exemption. Please request access through: Issue with "write_themes" and "write_themes_assets" scopes in GraphQL API or contact Shopify Partner Support to request write_themes scope exemption.
**
even though using theme app extensions do we need to exemption from you?

Theme-related Admin API mutations are not permitted from theme app extensions.

Theme app extension only = no permission required.
Any theme-related Admin API mutation = permission required.

I highly recommend following this tutorial so you can learn firsthand what is possible with theme app extensions:

We’ve developed a custom Shopify app without using the Shopify CLI, but using app bridge and frontend with polaris, and our primary goal is to provide SEO optimization features for merchants. One of the functionalities involves Meta tags optimisation, where we’d like to insert custom meta tags into a section of the respective pages.

I understand that theme-related Admin API mutations are not permitted from theme app extensions, but we’d like to clarify the following:

  • Can we use the Shopify CLI and theme app extension approach if our goal is only to inject meta tags in tag?

  • If yes, could you please provide guidance or reference documentation on how to safely add or modify meta tags through a theme app extension while staying within Shopify’s allowed practices?

Our intention is to ensure our implementation aligns fully with Shopify’s policies while enabling merchants to benefit from SEO improvements.
*
Here is our current folder structure:-*

Absolutely you can! :slight_smile:

Since meta tags are added to the <head> rather than <body>, you will want to create an ‘app embed block’ rather than a ‘app block’.

To get started on creating your app, I recommend:

  1. Following this tutorial to generate the theme app extension template.
  2. Modifying the app template to build your app inline with the guidance for app embed blocks: Configure theme app extensions
    For your app specifically you will want to set the target in the config schema to head.

Give that a go and let me know if you encounter any issues.

Just following up quickly to highlight this section of our dev docs about app embed blocks:

Use app embed blocks for the following types of apps:

  • Apps that add SEO meta tags, analytics, or tracking pixels.

Thank you for your previous response and the detailed guidance.

I’d like to provide additional clarity on our setup and ask a few specific questions to ensure we are fully aligned with Shopify’s policies.

We have built a Shopify SEO Optimization embedded partner app without using the Shopify CLI, relying instead on App Bridge, Polaris, and our own managed backend to handle all Shopify Admin API interactions.
During installation, we request the following scopes:

  • write_theme_code

  • read_themes

  • write_themes

Our main objective is to insert dynamic custom meta tags into the merchant’s theme.liquid file. Since this is a key SEO feature, we cannot expect merchants to manually paste meta tag code during installation.

However, we are facing a few limitations and need clarification:

  • Using Theme App Extensions requires the Shopify CLI, but our app is already fully built without it.

  • If we use an App Embed Block, merchants still need to manually enable it from the theme editor? And do we need permission to use an edit theme or enable App Embed Block apis**?**

  • And importantly, we have already attempted to enable the App Embed Block programmatically via the Admin API, but it returns an error, indicating that Shopify may not allow enabling embed blocks through API calls.

  • Currently our app is not public nor custom due to under development.

Given these constraints, we have several questions:

Questions

  1. Can a non-CLI app (built using App Bridge + Polaris + custom backend) still use a Theme App Extension only to add meta tags in the <head> through an App Embed Block?

  2. If possible, can we create only the Theme App Extension (via CLI) and integrate it into our existing custom app without converting our entire project into a Shopify CLI structure?

  3. Since enabling the App Embed Block via API resulted in an error, is there any Shopify-approved way to automatically enable the embed block during installation?

    • If not, can you confirm that embed block activation must always be done manually by the merchant?
  4. Given that our goal is only to add dynamic SEO meta tags, what is the recommended Shopify-compliant method for inserting meta tags without requiring merchants to perform manual steps?

  5. Is there any alternative approach (Admin API, GraphQL, metafields, app proxy, etc.) that Shopify recommends for dynamic meta tag injection without modifying theme files directly and without violating Theme App Extension restrictions?

1 & 2. I’ll need to verify this internally since there might be deployment challenges. The extension-only app approach should work fine for custom apps. However, if you’re planning to publish to the App Store, this approach may not be feasible. Can you tell me if you’re developing this app for a specific merchant or intend to make it available for many merchants?

  1. I highly recommend utilizing deep linking to streamline the process for merchants adding your app to their theme since it can automate most of the manual steps.

  2. There is no recommended Shopify-compliant method for inserting meta tags without merchant assistance. We want merchants to be aware of and have control over what they include in their theme.

  3. Public apps available in the app store that modify themes must use Theme App Extensions. See app public app requirements.
    Custom apps can use a ScriptTag instead of a Theme App Extension as an alternative, but it is not recommended. The benefit of ScriptTags is that there are no manual steps required of the merchant. However, this means that in the event their theme becomes incompatible with the app, they can’t turn simply toggle the app off from their theme, they will have to uninstall the app.

We Want to make it available for many merchants

Thank you for the information.

We are able to add the Theme App Extensions and we are able to use App Embed Block
right now we are asking merchant to enable it manually.
Is there a way we can automate it?

We have taken SEOAnt as a reference during installation they are enabling it automatically.
LINK:- SEOAnt: AI SEO & AI Blog Post - Best Shopify SEO tools | Shopify App Store

Great to hear!

The recommended approach to enabling theme app extensions is deep linking which requires a manual confirmation from the merchant.

If you encounter any apps achieving this automatically, they are likely using a legacy approach to editing the theme’s configuration file:

Thanks for the information

Following up on your earlier questions:

  1. Can a non-CLI app (built using App Bridge + Polaris + custom backend) still use a Theme App Extension only to add meta tags in the <head> through an App Embed Block?
  2. If possible, can we create only the Theme App Extension (via CLI) and integrate it into our existing custom app without converting our entire project into a Shopify CLI structure?

No to question 1, but yes to question 2.

You will need CLI to handle deployment of a public app with extensions. I recommend taking these steps:

  1. Follow this approach to make your app compatible with Shopify CLI:
    Migrate from a Dev Dashboard-managed app to Shopify CLI

  2. Follow this step so your app can be distributed publicly:
    Build an extension-only app

Let me know if you encounter any issues!