Define a post’s title and slug from Custom Fields

Try replacing $emp_fname = get_post_meta($postarr[‘ID’], ’emp_first_name’, true); $emp_lname = get_post_meta($postarr[‘ID’], ’emp_last_name’, true); with $emp_fname = $_POST[’emp_first_name’]; $emp_lname = $_POST[’emp_last_name’]; Replace the $_POST array keys with whatever the field name is on your form

Restrict WordPress Search to Custom Field

On WordPress you can filter searches when accessing the URL with an additional parameter on the end for example; https://www.your-website.com/?s=search-query&post_type=custom_post_type_name If you are accessing this URL from a search box / form on your website, add in the following hidden field; <input type=”hidden” name=”post_type” value=”post type name” />