Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:28:04+00:00 2026-06-14T14:28:04+00:00

Contact form 7 has some shortcodes, like [_date] to get todays date. But I

  • 0

Contact form 7 has some shortcodes, like [_date] to get todays date. But I want to display the date one week from now.

So I need to create a custom shortcode to Contact form 7 that takes say [next_week] and in the recived email the correct date is displayed.

Where and how do I create custom shortcodes to Contact form 7?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:28:05+00:00Added an answer on June 14, 2026 at 2:28 pm

    Add the following to your functions.php

    wpcf7_add_shortcode('custom_date', 'wpcf7_custom_date_shortcode_handler', true);
    
    function wpcf7_custom_date_shortcode_handler($tag) {
        if (!is_array($tag)) return '';
    
        $name = $tag['name'];
        if (empty($name)) return '';
    
        $next_week = date('Y-m-d', time() + (60*60*24*7)); 
        $html = '<input type="hidden" name="' . $name . '" value="' . $next_week . '" />';
        return $html;
    }
    

    Now in the “Form” field in CF7 GUI type [custom_date next_week]

    Now you can use [next_week] in the message body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm facing some problems with UTF-8 and ActionMailer. My application has a form (contact)
I'm trying to validate a contact form and I want to create some sort
I have a view called contact.html.twig. It has a form with some textfields. I
I'm working on a contact form for my church website. The church has an
A form on my website's contact -us HTML page has two fields 1) subject
I have a simple contact form with Subject and Message that I want to
I have a simple contact form on a website that has 2 text fields,
Hi guys i am using the mail() from the contact form and for some
I have a contact form that checks if some field is empty when you
I want to make a little contact form, where the user inputs his name,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.