# Create custom User Settings page form

**URL:** <https://community.hivepress.io/t/create-custom-user-settings-page-form/9758>\
**Category:** HivePress\
**Tags:** code\
**Created:** [February 16, 2024, 12:52pm UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758 "2024-02-16T12:52:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyva](https://community.hivepress.io/letter_avatar_proxy/v4/letter/h/e274bd/32.png) [@hyva](https://community.hivepress.io/u/hyva)\
**Post date:** [February 16, 2024, 12:52pm UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/1 "2024-02-16T12:52:47Z")

</div>

Hi, can anyone assist with how to create a custom form with only email, current password and new password fields? I would like to use it in a custom user account Security Settings Page for security settings separate from the user\_update form.

I tried to replicate the user\_update form based on the Model\_Form class and user controller files using a custom plugin but the field input data is not saved and the form is cleared up when the page is reloaded.

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [February 19, 2024, 10:44am UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/4 "2024-02-19T10:44:32Z")

</div>

Hi,

Unfortunately, there is no simple solution here, as this form should not require the current password, and the email cannot be edited without confirmation like a regular field. That is, to set this up correctly, you need a custom form, an action where the form will send the request, and you need to add the appropriate custom logic there. We recommend that you check out the GitHub to see how this form is made and the action itself: [hivepress/includes/controllers/class-user.php at master · hivepress/hivepress · GitHub](https://github.com/hivepress/hivepress/blob/master/includes/controllers/class-user.php#L614). Also, you can do this without necessarily using HivePress, as we use the WP Users API, so you can do it the way you want (through a third-party plugin or other custom implementation).

​I hope this is helpful to you.

---

<div class="post-metadata">

**Author:** ![hyva](https://community.hivepress.io/letter_avatar_proxy/v4/letter/h/e274bd/32.png) [@hyva](https://community.hivepress.io/u/hyva)\
**Post date:** [February 19, 2024, 12:20pm UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/5 "2024-02-19T12:20:11Z")

</div>

Yes, I modified this very function:

```auto
public function update_user( $request ) {
	}

```

…

Where I’m able to get my submitted custom form array data here:

`$form->set_values( $request->get_params() );`

But not saved even after getting a Settings saved notification here:

`$user->fill( $form->get_values() );`

…

So was wondering if there’s a step I’m missing that prevents the form data from being saved even after getting a success message.

---

<div class="post-metadata">

**Author:** ![hyva](https://community.hivepress.io/letter_avatar_proxy/v4/letter/h/e274bd/32.png) [@hyva](https://community.hivepress.io/u/hyva)\
**Post date:** [February 20, 2024, 7:37am UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/7 "2024-02-20T07:37:04Z")

</div>

Hi, I managed to get it working. Just one more thing, is there a code to conditionally add an attribute to only one specific form? I’m using this filter: hivepress/v1/models/user/attributes

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [February 21, 2024, 9:04am UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/9 "2024-02-21T09:04:00Z")

</div>

Hi,

Unfortunately, there is no such possibility since there is only one editable function and those that inherit it. Please note that if you edit the theme files directly, any update from our side will delete all your changes, so I recommend using this doc: [How to add custom code snippets - HivePress Help Center](https://help.hivepress.io/article/23-how-to-add-custom-code-snippets)

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [March 22, 2024, 9:04am UTC](https://community.hivepress.io/t/create-custom-user-settings-page-form/9758/10 "2024-03-22T09:04:35Z")

</div>

Closed on March 22, 2024, 9:04am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
