Contact Form 7 is an excellent WordPress plugin and one of the top choices of free WordPress plugins for contact forms. DTX – Dynamic Text Extension for Contact Form 7 makes it even more awesome by adding dynamic content capabilities. While default values in Contact Form 7 are static, DTX lets you c
PricingFree downloadThe WordPress.org download is free. Pro versions, add-ons or external services may cost extra.
CompatibilityRequires WordPress 5.5 and PHP 7.4.
SourceWordPress plugins · Nov 9, 2026
01 / Source details
Aboutthistool.
Contact Form 7 is an excellent WordPress plugin and one of the top choices of free WordPress plugins for contact forms. DTX – Dynamic Text Extension for Contact Form 7 makes it even more awesome by adding dynamic content capabilities. While default values in Contact Form 7 are static, DTX lets you create pre-populated fields pulled from other locations. Some examples might include:
Auto-filling a URL or just getting the domain name or path
Auto-filling a post ID, title, or slug
Auto-filling a title, URL, or slug for the current page
Pre-populating a product number
Referencing other content on the site
Populating with post or page info
Populating with the current user’s info
Populating with custom and meta fields
Generating unique identifiers for support tickets
Getting a list of post categories or other custom taxonomies
Getting a value from a cookie
Getting custom theme modifications
Any value using custom shortcodes
The possibilities are endless!
View Demo
For over 10 years, DTX only handled <input type="text" /> and <input type="hidden" /> form fields, but version 4 finally introduces more:
submit (yes, a submit button where you can have dynamic text!)
WHAT DOES IT DO?
DTX provides flexibility to WordPress users in creating dynamic forms in Contact Form 7. DTX comes with several built-in shortcodes that will allow the contact form to be populated from HTTPS GET variable or any info from the get_bloginfo() function, among others. See below for included shortcodes.
Don’t see the shortcode you need on the list? You can write a custom one ! Any shortcode that returns a string or numeric value can be used here. The included shortcodes just cover the most common scenarios, but DTX provides the flexibility for you to grab any value you have access to programmatically.
Dynamic Value
The bread and butter of this plugin, set a dynamic value! This field can take any shortcode, with two important provisions:
01The shortcode should NOT include the normal square brackets ( [ and ] ). So, instead of [CF7_GET key='value'] you would use CF7_GET key='value' .
02Any parameters in the shortcode must use single quotes. That is: CF7_GET key='value' and not CF7_GET key="value"
Dynamic Placeholder
Set a dynamic placeholder with this attribute! This feature accepts static text or a shortcode. If using a shortcode, the same syntax applies from the dynamic value field. However, this field also has a few more needs:
03The text/shortcode must first have apostrophes converted to it’s HTML entity code, '
04After that, it must be URL encoded so that spaces become %20 and other non-alphanumeric characters are converted.
If you’re using Contact Form 7’s tag generator to create the form tag, those extra needs are already taken care of. Dynamic placeholders are not available for dynamic hidden form tags.
Learn more and see examples from the DTX Knowledge base .
Compatible with Caching Plugins
DTX is cache friendly! You can set a field to be calculated after the page loads by setting the dtx_pageload attribute to any dynamic form tag.
Many websites use caching plugins to optimize for performance. If your website caches the HTML of the form, then any dynamic form fields you have get their first calculated value cached alongside it. This becomes an issue if you’re using DTX to pull values from a cookie or the current URL’s query string.
This is best for dynamic form fields that:
gets the current URL
gets a value from the URL query
gets a value from a cookie
gets the current user’s info
generates a unique identifier (GUID)
For dynamic fields that are page-specific, it’s perfectly safe to cache those values. For example, dynamic form fields that:
getting the page or post’s ID, title, or slug
getting post meta for the current page
getting the post’s assigned categories, tags, or other custom taxonomy
getting site info
getting theme modification values
Note: Enabling a dynamic field to be calculated after the page loads will add frontend JavaScript. Depending on the shortcode used as the dynamic value, an AJAX call to the server may be sent to be processed. The script is minified and loaded in the footer and is deferred, minimizing impact on site performance and the AJAX calls are called asynchronously to avoid being a render-blocking resource and minimizing main-thread work. The script itself can be safely cached too.
Learn more and see examples from the DTX Knowledge base .
Read Only Form Fields
Check this box if you do not want to let users edit this field. It will add the readonly attribute to the input form field. This feature is not available for dynamic hidden form tags.
Obfuscate Values for Enhanced Privacy
If you’re pre-filling a form field with an email address, bots can scrape that value from the page and use it for spam. You can add an additional layer of protecting by obfuscating the value, which turns each character into it’s ASCII code. To the human eye, it looks like the character it’s supposed to be because browsers will render the ASCII code, but for bots, it won’t look like an email address!
HOW TO USE IT
After installing and activating the plugin, you will have 2 new tag types to select from when creating or editing a Contact Form 7 form: the dynamic text field and dynamic hidden field. Most of the options in their tag generators will be familiar to Contact Form 7 users but there have been some upgrades.
How to Obfuscate Values
All of the shortcodes included with the DTX plugin allow the obfuscate attribute that you can set to any truthy value to provide an additional layer of security for sensitive data.
The Contact Form 7 tag with obfuscation turned on would look like this: [dynamictext user_email "CF7_get_current_user key='user_email' obfuscate='on'"]
How to Enable Cache-Friendly Mode
All of the dynamic form tags can be enabled for processing on the frontend of the website, or the client-side, by adding the dtx_pageload attribute to the Contact Form 7 form tag.
In the form editor of Contact Form 7, your form tag would look like: [dynamictext current_url dtx_pageload "CF7_URL"]
If using the tag generator, it’s as simple as checking a box!
INCLUDED SHORTCODES
The plugin includes several shortcodes for use with the Dynamic Text Extension right out of the box. You can write your own as well—any self-closing shortcode will work, even with attributes!
Current URL or Part
Retrieve the current URL: CF7_URL
In the form editor of Contact Form 7, your form tag would look like: [dynamictext dynamicname "CF7_URL"]
Optional parameter: part , which will return a parsed part of the URL. Valid values are host , query , and path
Host: Just the domain name and tld [dynamictext host “CF7_URL part=’host'”]
Query: The query string after the ?, if one exists [dynamictext query “CF7_URL part=’query'”]
Path: The URL path, for example, /contact, if one exists [dynamictext path “CF7_URL part=’path'”]
Learn more and see examples from the DTX Knowledge base .
Referrer URL
Get the referral URL, if it exists. Note that this is not necessarily reliable as not all browsers send this data.
CF7 Tag: [dynamictext dynamicname "CF7_referrer"]
Learn more and see examples from the DTX Knowledge base .
Current Page Variables
Retrieve information about the current page that the contact form is displayed on. Works great for use in templated areas like the site header, footer, widget, or sidebar! The shortcode works as follows:
Built-in shortcode: CF7_get_current_var
Required attribute: key
Possible values for key include:
id
title
url (an alias for CF7_URL )
slug
featured_image
terms (an alias for CF7_get_taxonomy )
For pages that use a WP_POST object, this acts as an alias for CF7_get_post_var so those attributes work here as well.
For author pages, this acts as an alias for CF7_get_current_user so those attributes work here as well.
In the form editor of Contact Form 7, your form tag’s value could look like: CF7_get_current_var key='title'
And then the full form tag would be: [dynamictext dynamicname "CF7_get_current_var key='title'"]
Learn more and see examples from the DTX Knowledge base .
Post/Page Info
Retrieve information about the current post or page (must be for a WP_POST object) that the contact form is displayed on. The shortcode works as follows:
CF7_get_post_var key='title' <-- retrieves the Post's Title CF7_get_post_var key='slug' <-- retrieves the Post's Slug
You can also retrieve any parameter from the global $post object. Just set that as the key value, for example post_date
The Contact Form 7 Tag would look like: [dynamictext dynamicname "CF7_get_post_var key='title'"]
Need to pull data from a different post/page? Not a problem! Just specify it’s post ID like this:
Contact Form 7 Tag: [dynamictext dynamicname "CF7_get_post_var key='title' post_id='245'"]
Learn more and see examples from the DTX Knowledge base .
Post Meta & Custom Fields
Retrieve custom fields from the current post/page. Just set the custom field as the key in the shortcode.
Note: You must add any meta keys that you want to allow access to to the allow list in your admin panel > Contact > Dynamic Text Extension > Meta Key Allow List. More Information
The dynamic value input becomes: CF7_get_custom_field key='my_custom_field'
And the tag looks like this: [dynamictext dynamicname "CF7_get_custom_field key='my_custom_field'"]
For the purposes of including an email address, you can obfuscate the custom field value by setting obfuscate=’on’ in the shortcode like this: [dynamictext dynamicname “CF7_get_custom_field key=’my_custom_field’ obfuscate=’on'”]
Learn more and see examples from the DTX Knowledge base .
Featured Images & Media Attachments
Retrieve the current post’s featured image, the featured image of a different page, or any attachment from the Media Library with this shortcode!
The base shortcode is simply: CF7_get_attachment which returns the absolute URL of the cur
See it in action
Screenshots & previews.
Screenshot of the form tag buttons in the form editor of Contact Form 7. The dynamic buttons appear in purple instead of blue to visually set them apart.The form tag generator screen for the dynamic text form tagThe form tag generator screen for the dynamic hidden form tagThe form tag generator screen for the dynamic email form tagThe form tag generator screen for the dynamic URL form tagThe form tag generator screen for the dynamic phone number (tel) form tagThe form tag generator screen for the dynamic number spinbox form tagThe form tag generator screen for the dynamic sliding range form tagThe form tag generator screen for the dynamic textarea form tagThe form tag generator screen for the dynamic drop-down menu (select) form tagThe form tag generator screen for the dynamic checkboxes form tagThe form tag generator screen for the dynamic radio buttons form tagThe form tag generator screen for the dynamic date form tagThe form tag generator screen for the dynamic submit form tag
02 / Source details
Gettingstarted.
Minimum Requirements
To ensure your WordPress installation meets these requirements, you can login to your WordPress website and navigate to Tools > Site Health and click on the Info tab. Expand the WordPress , Active Plugins , and Server accordions and compare that information with the details below.
01WordPress version 5.5 or greater
02PHP version 7.4 or greater
03Contact Form 7 version 5.7 or greater
There are three (3) ways to install my plugin: automatically, upload, or manually.
Install Method 1: Automatic Installation
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser.
04Log in to your WordPress dashboard.
05Navigate to Plugins > Add New .
06Where it says “Keyword” in a dropdown, change it to “Author”
07In the search form, type “TessaWatkinsLLC” (results may begin populating as you type but my plugins will only show when the full name is there)
08Once you’ve found my plugin in the search results that appear, click the Install Now button and wait for the installation process to complete.
09Once the installation process is completed, click the Activate button to activate my plugin.
Install Method 2: Upload via WordPress Admin
This method involves is a little more involved. You don’t need to leave your web browser, but you’ll need to download and then upload the files yourself.
10Download my plugin from WordPress.org; it will be in the form of a zip file.
11Log in to your WordPress dashboard.
12Navigate to Plugins > Add New .
13Click the Upload Plugin button at the top of the screen.
14Select the zip file from your local file system that was downloaded in step 1.
15Click the Install Now button and wait for the installation process to complete.
16Once the installation process is completed, click the Activate button to activate my plugin.
Install Method 3: Manual Installation
This method is the most involved as it requires you to be familiar with the process of transferring files using an SFTP client.
17Download my plugin from WordPress.org; it will be in the form of a zip file.
18Unzip the contents; you should have a single folder named contact-form-7-dynamic-text-extension .
19Connect to your WordPress server with your favorite SFTP client.
20Copy the folder from step 2 to the /wp-content/plugins/ folder in your WordPress directory. Once the folder and all of its files are there, installation is complete.
21Now log in to your WordPress dashboard.
22Navigate to Plugins > Installed Plugins . You should now see my plugin in your list.
23Click the Activate button under my plugin to activate it.
03 / Source details
Frequently asked questions.
Where do I report security bugs found in this plugin?
Please report security bugs found in the source code of DTX – Dynamic Text Extension for Contact Form 7 WordPress plugin through the Wordfence Intelligence Vulnerability Submission Form or the Patchstack Vulnerability Disclosure Program . Both platforms can assist you with verification, CVE assignment, and notify me without publicly disclosing details that could put websites at risk.
Where can I contribute?
Feel free to check out the GitHub repository . Thanks!
FinderPress Media Auditor helps site administrators scan for broken images, missing Media Library files, unreachable media URLs, and other media issues across WordPress content. Use it to audit images, video, audio, PDFs, featured images, and attachment files without sending scan data to an external
The Accepted Payment Methods plugin is a straightforward, lightweight solution that enhances your website by displaying visually appealing icons of the payment methods you accept. This plugin is ideal for a variety of websites, including e-commerce platforms, service-oriented websites, and informati