Guides/Edit your website/Themes/Edit theme files directly

Edit theme files directly

Last reviewed on December 12, 2025

The Theme File Editor is a tool on WordPress for directly editing the code of your theme. This tool is for users with programming knowledge. If you’re new to coding, we recommend using the alternatives listed below instead to avoid accidentally breaking your site.

This feature is available on plugin-enabled sites with our WordPress.com Personal, Premium, Business, and Commerce plans. If your site has one of these plans, make sure to activate it. For sites on the free plan, upgrade your plan to access this feature.

Alternatives to the Theme File Editor

You can customize your site without using the Theme File Editor. Here are safer alternatives:

  • To add verification codes (like for Google AdSense), you can use a plugin. Follow our Add code to your site headers guide for instructions.
  • To add functionality, use the Code Snippets plugin to add small pieces of PHP code safely.
  • To change your theme’s appearance, use the Site Editor on block-based themes to modify structure and style without coding.
  • To add custom styles, use the CSS editor to add CSS code to your entire site.
  • For more extensive changes, create a child theme that inherits from your main theme.
  • To manage theme files directly, use SFTP to upload and manage files.

Access the Theme File Editor

Follow these steps to access the Theme File Editor:

  1. Go to your site’s dashboard.
  2. Navigate to Tools → Theme File Editor
    • If you don’t see this option, your theme doesn’t support direct file editing.
  3. In the upper-right corner, select the theme you want to edit from the dropdown menu labeled “Select theme to edit” and click the “Select” button.
  4. On the right side, click on the specific theme file you want to edit. The file will open in the code editor on the left.
  5. Make your changes to the code.
  6. Click the “Update File” button at the bottom to save your changes.
The theme file editor interface.

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!