Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Change the contents of a dropdown through the admin panel?

I think this is really what taxonomies are for, so if a custom taxonomy won’t work, you could always still create the custom taxonomy and populate the drop down with the taxonomy. This would allow the user to create new terms via the taxonomy. There is a plugin called Meta Box, and it makes stuff like this a breeze!

Update
After commenting with you back and forth below, I think what you are really looking for is just a custom taxonomy that will allow the user to add, subtract, and apply terms to a post or page. A taxonomy is one of those boxes on the right side of the post or page creation screen like “tags” or “categories” that allows a user to add terms to a post, which allow the posts to be searchable, more organized and much more filterable.

If you want you can just copy paste this into your functions.php file to create a new taxonomy and append it to the posts and pages admin screen. This is straight from the WP documentation.

// hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'create_places_taxonomies', 0 );

// create two taxonomies, places and writers for the post type "book"
function create_places_taxonomies() {
    // Add new taxonomy, make it hierarchical (like categories)
    $labels = array(
        'name'              => _x( 'Places', 'taxonomy general name' ),
        'singular_name'     => _x( 'Place', 'taxonomy singular name' ),
        'search_items'      => __( 'Search Places' ),
        'all_items'         => __( 'All Places' ),
        'parent_item'       => __( 'Parent Place' ),
        'parent_item_colon' => __( 'Parent Place:' ),
        'edit_item'         => __( 'Edit Place' ),
        'update_item'       => __( 'Update Place' ),
        'add_new_item'      => __( 'Add New Place' ),
        'new_item_name'     => __( 'New Place Name' ),
        'menu_name'         => __( 'Place' ),
    );

    $args = array(
        'hierarchical'      => true,
        'labels'            => $labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'places' ),
    );

    register_taxonomy( 'places', array( 'post', 'page' ), $args );
}

If you would like to change the functionality to a more “tag” like function, then simply changed the hierarchical setting to false.

'hierarchical'      => true,

You really should be using taxonomies to perform this function rather than a custom drop down box. Should your client want to expand upon the functionality, this is going to make it very easy to do so in the future.

Related Posts:

  1. Query all posts where a meta key does not exist
  2. Correctly delete posts with meta and attachments [duplicate]
  3. Storing revisions of metadata for custom post type
  4. Admin Area Custom Type Search By Meta Fields Without Title & Content
  5. How can I filter posts by post_parent in the admin?
  6. Custom Post Type with Input fields to seperate table on database.
  7. How to create a mini directory in WordPress?
  8. How Can I save multiple records in same meta key?
  9. Detect meta value changes when post is updated (post_updated)
  10. Search everything (posts, pages, tags, cpt, meta)
  11. Permalinks using event date (year & month) instead of publication date
  12. Compare 3 custom fields and sort by oldest
  13. Creating a custom post type upon registration
  14. Reason action hook won’t work with update_post_meta from frontend form? Alternative?
  15. Can’t sort order of wp_query with 2 meta keys
  16. Showing Meta Data for Custom Post Types?
  17. How to get source of custom meta image?
  18. Having trouble with custom post type / meta box
  19. Query for posts from any post type but only add instock products
  20. update custom post type meta from a shortcode
  21. Custom Meta Boxes – Nonce Issue – Move to trash issue
  22. Displaying Meta Box Image
  23. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  24. Show metabox in custom-post-template depending on taxonomy term?
  25. ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
  26. Using date stored as custom field to filter posts displayed in admin
  27. Meta Box Only in CPT Edit Page, Not in Add New
  28. get_post_meta is returning image id
  29. get_template_part() – post-meta not working?
  30. Metadata for a taxonomy – is there any WordPress way of doing this?
  31. Does WordPress limit the length of slug names for Post Meta or Terms?
  32. Populate Custom Fields in a Custom Post Type?
  33. Update CPT post meta with update_post_meta and cron job
  34. Custom meta box data array: foreach not working correctly?
  35. Undefined Variable – Custom Post Type Meta
  36. How to check if user meta field is empty in conditional else statement
  37. Get posts between custom dates
  38. Getting meta in editor plugin, and event triggering issue
  39. A better way to add a meta box to custom post types
  40. Should wp_postmeta meta_key always be unique for a given post_id?
  41. How do I set all of a particular post meta to a value within the custom post type I’m in?
  42. Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
  43. Importing Data from a Non-WordPress database, into WP
  44. List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
  45. Meta Data for Custom Post Type not saving
  46. Check if post with same meta value exists
  47. Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
  48. Archieve.php not loading for custom post type
  49. Create Array from custom post type to display a slider
  50. Values from meta-box not on $_POST
  51. Returning a custom content types with meta values
  52. copy images from custom field to another custom field
  53. Cannot obtain custom meta information
  54. is_main_query() never called on WP 4.4
  55. How can I output WPAlchemy repeating fields meta values in my page template?
  56. Save Metabox Custom Field Value
  57. Meta box data not saving
  58. How can I get some of a posts meta data whilst it is still inserting?
  59. How to retrive Custom Post Type Meta Fields in Custom WP_Query
  60. Cannot Save MetaBox Data in Custom Post Type
  61. best way to use custom taxonomy, post type and meta in a job system
  62. Empty meta-box returns publishdate if no value is set?
  63. Building tags and archive using meta from custom post type
  64. How to order custom posts by one of the custom fields value, ‘date’?
  65. Custom Meta Box with variable number of fields
  66. WordPress CPT Taxonomy Dashboard Search – How to include taxonomy in search?
  67. Custom Post Type meta data getting deleted on bulk editing taxonomies
  68. How to create review point system for CPTs (many-to-many relationship)
  69. After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
  70. How can I write a function that would update any missing specific post metadata?
  71. SELECT custom post type and its meta in SQL
  72. How to keep custom post type related information
  73. Custom attachment function not working in v5.4.2?
  74. Can’t save meta box data in WordPress using custom post types
  75. How to return/export only data showing on screen in custom post type view all screen
  76. Use WP_query to match post types based on custom field values
  77. How can I use a custom template to load custom post type posts based on a post_meta value
  78. How to properly get the wp_postmeta.meta_value of a custom post type in specifics?
  79. Custom Function to redirect singular post if specific meta field is empty
  80. Stored meta from attachment, video length?
  81. Saving Child Terms on front end not setting parent
  82. Custom post type: “transition_post_status” action get title and other fields
  83. update a posts of other custom post type
  84. How do I extract the contents of a CPT’s custom field for all posts?
  85. How to get post meta for custom post type and taxonomy
  86. Delete custom post type metadata without deleting the post in admin area
  87. Order by post meta value gets random results
  88. How to create content automatically when a post is published?
  89. Rich Custom Field for Custom Post type not saving
  90. Add auto increment value to custom meta
  91. Return only custom post types for the page, not all
  92. Querying meta values within an array
  93. Post AND page parameter for WP function
  94. why get_post_meta is returning 0?
  95. Save post_parent in a custom post type
  96. How to display Author Profile based on Custom field value
  97. Automatically add custom taxonomy when meta value gets to a set number or beyond
  98. Display a list of posts whose meta field values are equal to the ID of the post being viewed?
  99. Check for custom field value in different post type than current one and do something
  100. I am having a problem with fetching product data in the Gutenberg block editor
Categories custom-post-types Tags custom-post-types, post-meta
How to customize admin edit page – custom type
Posts2Posts, wp_query and orderby issue

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress