# Override default form title

**URL:** <https://community.gravityforms.com/t/override-default-form-title/2574>\
**Category:** Get Help\
**Tags:** form-title, gform\_pre\_render\
**Created:** [August 28, 2019, 3:02pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574 "2019-08-28T15:02:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [August 28, 2019, 3:02pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/1 "2019-08-28T15:02:35Z")

</div>

I’m guessing this has been asked before, but I couldn’t find the answer anywhere.

I have a single form that I use in multiple pages/posts with my Call to Action. Because each post targets a different felt need, I’d like to have a different title for each form to override the default form title. I.e., [gravityforms id=‘1’ alternate\_title=‘Custom felt need title’].

Is there a way to simply do this? I see the [gform\_shortcode\_ACTION](https://docs.gravityforms.com/gform_shortcode_form_property/) method but not sure if this is the best approach.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [August 29, 2019, 3:23pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/2 "2019-08-29T15:23:43Z")

</div>

You can use the gform\_pre\_render filter for that

> **[gform\_pre\_render - Gravity Forms Documentation](https://docs.gravityforms.com/gform_pre_render/)**
>
> The gform\_pre\_render filter is executed before the form is displayed and can be used to manipulate the Form Object prior to rendering the form.

You would test the page ID, and modify `$form['title']` to be whatever you want before showing the form.

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [August 29, 2019, 11:46pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/3 "2019-08-29T23:46:53Z")

</div>

Chris,

Thank you. You said I needed to test the form id. Could I instead simply test for an optional parameter to be passed and if so, replace the title of the current form being called in the short code? Sorry, I’m still very new to Gravity Forms and how their hooks work.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [August 30, 2019, 12:25pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/4 "2019-08-30T12:25:55Z")

</div>

You could test for whatever you like. It would look something like this:

```auto
add_filter( 'gform_pre_render', 'set_form_title' );
function set_form_title( $form ) {
	// Set form title based on some conditional test
	if ( $something == 'whatever' ) {
		$form['title'] = "My New Title";
		return $form;
	}
	return $form;
}

```

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [August 30, 2019, 1:47pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/5 "2019-08-30T13:47:36Z")

</div>

Chris,

Thank you very much! I’ll try that out.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [August 30, 2019, 2:59pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/6 "2019-08-30T14:59:34Z")

</div>

Let us know if you get stuck.

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [September 1, 2019, 9:53pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/7 "2019-09-01T21:53:42Z")

</div>

Chris,

Sorry, I got stuck. Part of it is probably my lack of PHP experience.

I see the following example of shortcodes passing parameter values:

> [gravityform id=1 field\_values=’parameter\_name1=value1&parameter\_name2=value2′]

However, I haven’t been able to find how to refer to the named parameter and it’s value in the short code via PHP. Everything I’ve found appears to apply to dynamically populating fields which I don’t think is what I need. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 2, 2019, 3:05pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/8 "2019-09-02T15:05:29Z")

</div>

Shortcodes are not going to help. What code did you try based on my example? Can you share that code here?

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [September 2, 2019, 9:17pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/9 "2019-09-02T21:17:05Z")

</div>

Chris, sorry. My intent from the beginning was to try and pass a parameter in the shortcode that would override the default title/label that is displayed. Since I was coming from that angle, I was trying to figure out how to grab the shortcode params to use in your example, but couldn’t get figure out how to grab them. Sorry, if I wasn’t clear about my intent.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 4, 2019, 11:20am UTC](https://community.gravityforms.com/t/override-default-form-title/2574/10 "2019-09-04T11:20:18Z")

</div>

Sorry about that. You were clear from the beginning that you wanted to change the form title with the shortcode, using the filter you linked to. I was coming at it from another angle. Let me work on this a little and see if I can get you an example to extend the shortcode to allow for this.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 5, 2019, 4:40am UTC](https://community.gravityforms.com/t/override-default-form-title/2574/11 "2019-09-05T04:40:21Z")

</div>

I have not been able to make this work yet using the gform\_shortcode\_ACTION filter. However, what if you just used `title="false"` in the shortcode, and then added a custom title to the page where you have embedded the form? Or even just used the page title with the form coming right after? Because you have control over the page content (where the shortcode would be edited) maybe that will work for you?

I will keep looking at this, but I could not find anyone asking for this previously and the last code examples we sent out for this were in 2016 (and only six total between 2013 and today)!

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [September 5, 2019, 1:29pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/12 "2019-09-05T13:29:24Z")

</div>

Chris, thank you for continuing to research this. I have used title=‘false’ several times and just added html for the title I wanted displayed. I guess I’ll go back to that. Thank you again for your help.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 6, 2019, 8:46pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/13 "2019-09-06T20:46:46Z")

</div>

After working with this a bit more, it became apparent that the [https://docs.gravityforms.com/gform\_shortcode\_form\_property/](https://docs.gravityforms.com/gform_shortcode_form_property/) filter is to extend the [gravityforms] shortcode to do other things. It will not return the form in addition to doing those other things.

**Some example uses:**

Show entry counts:  
[https://gravitywiz.com/shortcode-display-number-entries-submitted/](https://gravitywiz.com/shortcode-display-number-entries-submitted/)

Show Poll results:

> **[Poll Shortcode - Gravity Forms Documentation](https://docs.gravityforms.com/poll-shortcodes/)**
>
> The Polls shortcode uses the standard Gravity Forms shortcode but introduces a new action that tells Gravity Forms to make the form behave as a poll.

Show login form:

> **[Login Form Shortcode - Gravity Forms Documentation](https://docs.gravityforms.com/user-registration-login-shortcode/)**
>
> The Gravity Forms User Registration plug-in adds a couple of shortcode actions that extends the possibilities for your Gravity Forms shortcode.

Show user information:

> **[The User Information Shortcode - Gravity Forms Documentation](https://docs.gravityforms.com/user-shortcode-within-user-registration-add/)**
>
> The User Registration Add-On includes additional shortcodes that can be used to display additional information about a currently logged in or specific user. This article explains how to use this shortcode.

Conditional shortcode usage:

> **[Conditional Shortcode - Gravity Forms Documentation](https://docs.gravityforms.com/conditional-shortcode/)**
>
> The conditional shortcode allows you to perform conditional logic in the message content of your Admin and User Notification emails as well as the Confirmation Message that is displayed when a form is submitted.

---

<div class="post-metadata">

**Author:** ![solutionsguy1](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@solutionsguy1](https://community.gravityforms.com/u/solutionsguy1)\
**Post date:** [September 7, 2019, 1:47pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/14 "2019-09-07T13:47:52Z")

</div>

Chris,

Thank you for continuing to work on this. I appreciate it. I assume you didn’t mean to include the word not in the following?

> It will _not_ return the form in addition to doing those other things.

Thank you again. I’ll spend some time working on this.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 8, 2019, 1:51am UTC](https://community.gravityforms.com/t/override-default-form-title/2574/15 "2019-09-08T01:51:10Z")

</div>

No, I **definitely** meant to include the word **not**. That shortcode does NOT return a form. In general, it is used to return other information, not return the form.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 4, 2022, 5:19pm UTC](https://community.gravityforms.com/t/override-default-form-title/2574/16 "2022-01-04T17:19:35Z")

</div>


