ACF Code Field


Code field for Advanced Custom Fields. Works with ACF versions 4 (free) and 5 (Pro). Based on the Codemirror javascript plugin.

Plugin requires ACF free or pro to be installed to function.


  • Settings page screenshot
  • Editor screenshot with the Monokai theme enabled.


Installation Instructions
  1. Upload the plugin files to the /wp-content/plugins/acf-code-field directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. In the ACF custom fields manager, the option for the code field will be under the “Field Type” drop down under “Code Tools”
What version fo ACF does this work with?

Currently the plugin works with the free (v4) and PRO (v5) versions.

Does the plugin escape or sanitize any data?

It doesn’t. Though Codemirror has several settings to escape data, the plugin doesn’t implement them


Must have of any ACF site

Much better than using a plugin that “Adds css/html/js” to pages. Those are always crap, easier to use ACF like this and manage it yourself.


Works really nice.
If it would come with some settings to maybe even have code autocompletion it would be even better. But even as it is, it is a wonderful plugin. Thank you very much for it!

Great plugin

I love this plugin. Great job I will add one star if PHP support is added to the list of supported languages.

Long Awaited, Deeply Appreciated, Needs One More Thing

Kudos to Peter Tasker for stepping up and creating this plugin for Advanced Custom Fields (ACF).

I had been using a similar plugin with the ACF free version but when I upgraded to Pro, it stopped working. This plugin works with the Pro version of ACF.

Its only shortcoming is that it doesn’t work inside ACF Pro’s flexible fields. That’s a shame because flexible fields have totally revolutionized the way I build landing pages. I’m currently using ACF text-areas for the parts of my designs that require HTML but I’d really like to be able to use the code field. So, I hope Peter addresses this quickly.

To help him along, I’ve sent him a cup of coffee through the “Donate to this Plugin” link. You should, too.

Read all 4 reviews

Contributors & Developers

“ACF Code Field” is open source software. The following people have contributed to this plugin.


Translate “ACF Code Field” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Readme.txt fix for new UI
  • CSS fix for flexible content areas


  • Loading in all CodeMirror css themes as options for editor colors
  • Adding PHP support to the v4 plugin
  • Updating codemirror to version 5.23


  • Bumping tested up to version


  • Improvement: Adding PHP language editor support
  • Improvement: Making height automatically grow to the height of the content
  • Bug fix: Hidden panels using the code field need to be clicked on to display contents


  • Bug Fix: Adding support for flexible content fields
  • Bug Fix: Correctly adding multiple stylesheets if multiple fields themes are selected on the same page


  • First deploy and commit to repository