WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Could someone explain me with a little example how create a button that creates a new custom field dynamically?

I'm working on a plugin and using add_meta_box, I need an input box (administration-side) and a button that when clicked will create a new input box, after saving the previous data (on a custom database).

share|improve this question
Are you looking for something like this - web-design-talk.co.uk/examples/2/1 You want to add many values under one custom field just like that example ? – amit Jul 11 '12 at 15:29
yes! Exactly! Could you help me with a simple example of this in case of a form in a post-new.php ? How do this with a plugin ? – Francesco Jul 13 '12 at 9:04

You are looking for Repeatable Fields.

Here in WPSE, it was covered in the following Q&A:
Custom Meta Boxes: Store two values in one repeatable field

A Gist:

Class helpers for building the plugin options page:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.