Author Archive

Tutorial: Adding a new text field for jobs

Tutorial: Adding a new text field for jobs

Note: All code examples are provided for developer reference only. Support does not include debugging code examples.

This tutorial demonstrates how to add a custom field to job submissions and display it on single job listings. For a no-code solution, consider the Field Editor add-on.

Add the field to the frontend

In your theme’s functions.php or a functionality plugin, hook into the submission form:

add_filter( 'submit_job_form_fields', 'frontend_add_benefits_field' );

Then create the function:

function frontend_add_benefits_field( $fields ) {
  $fields['job']['job_benefits'] = array(
    'label'       => __( 'Benefits', 'job_manager' ),
    'type'        => 'text',
    'required'    => true,
    'placeholder' => 'e.g. 401k, health insurance, company car',
    'priority'    => 7
  );
  return $fields;
}

This adds a required benefits text field with priority 7 positioning.

Add the field to admin

Hook into the admin fields filter:

add_filter( 'job_manager_job_listing_data_fields', 'admin_add_benefits_field' );

Then write the function:

function admin_add_benefits_field( $fields ) {
  $fields['_job_benefits'] = array(
    'label'       => __( 'Benefits', 'job_manager' ),
    'type'        => 'text',
    'placeholder' => 'e.g. 401k, health insurance, company car',
    'description' => ''
  );
  return $fields;
}

Note the underscore prefix on the field name; this creates hidden meta automatically.

Display “Benefits” on the single job page

Use an action hook to display the field:

add_action( 'single_job_listing_meta_end', 'display_job_benefits_data' );

Create the display function:

function display_job_benefits_data() {
  global $post;
  $benefits = get_post_meta( $post->ID, '_job_benefits', true );
  if ( $benefits ) {
    echo '
  • ' . __( 'Benefits: ' ) . esc_html( $benefits ) . '
  • '; } }

    Tutorial: Importing Job Listings With WP All Import Pro

    Note: All code examples and 3rd party plugin suggestions are provided for reference only. Support does not include assistance with modifying code or 3rd party plugins.

    WP All Import Pro enables importing posts and custom post types like job listings using CSV and XML files. The Pro version is required for importing custom fields used by WPJM.

    Preparing Your CSV File

    Consider including these columns:

    • Job Title
    • Job Description
    • Job Location
    • Job Application (email or URL)
    • Company Name
    • Company Tagline
    • Company Website Address
    • Company Twitter Handle
    • Company Logo URL
    • Company Video URL
    • Job Type

    Importing Your CSV File

    Access the All Import section and select “New Import.” Upload your CSV file and choose to create new Jobs. Once uploaded successfully, review the preview.

    In step 3, map CSV columns to job fields. Map post title and content to job title and description respectively.

    Custom Field Mappings:

    • Job Location -> _job_location
    • Job Application -> _job_application
    • Company Name -> _company_name
    • Company Tagline -> _company_tagline
    • Company Website -> _company_website
    • Company Twitter -> _company_twitter
    • Company Logo -> _company_image
    • Company Video -> _company_video

    Map job type and categories in the taxonomies section, then set a unique identifier and complete the import.

    Applications: Customising Application Statuses

    Applications by default has the following statuses (these are custom post type statuses):

    1. New
    2. Interviewed
    3. Offer Extended
    4. Hired
    5. Archived
    6. Rejected

    From version 1.7.0+ these statuses can be customised by using the filter job_application_statuses.

    Adding a Status Example

    This example adds a new status called ‘Example’. The code would be placed in your theme functions.php file or a custom plugin.

    add_filter( 'job_application_statuses', 'add_new_job_application_status' );
    
    function add_new_job_application_status( $statuses ) {
    	$statuses['example'] = _x( 'Example', 'job_application', 'wp-job-manager-applications' );
    	$statuses['another_example'] = _x( 'Another Example', 'job_application', 'wp-job-manager-applications' );
    	$statuses['a_third_example'] = _x( 'A Third Example', 'job_application', 'wp-job-manager-applications' );
    	return $statuses;
    }

    Removing a Status Example

    This example removes the ‘offer extended’ status.

    add_filter( 'job_application_statuses', 'add_new_job_application_status' );
    
    function add_new_job_application_status( $statuses ) {
    	unset( $statuses['offer'] );
    	return $statuses;
    }

    Tutorial: Changing the job slug/permalink

    Changing the job slug/permalink

    Job listings in WP Job Manager default to the permalink ‘jobs’. For example, a job may have the URL: http://yoursite.com/jobs/job-listing-title

    Important: After changing the slug, resave your permalinks. Go to Settings > Permalinks and click save.

    Changing the permalink base using filters

    Add custom code to your theme’s functions.php to filter the permalink. For example, change ‘jobs’ to ‘careers’:

    function change_job_listing_slug( $args ) {
      $args['rewrite']['slug'] = _x( 'careers', 'Job permalink - resave permalinks after changing this', 'job_manager' );
      return $args;
    }
    add_filter( 'register_post_type_job_listing', 'change_job_listing_slug' );

    Changing the permalink slug for new jobs

    Customize job permalinks using filters in your theme’s functions.php:

    add_filter( 'submit_job_form_prefix_post_name_with_company', '__return_false' );
    add_filter( 'submit_job_form_prefix_post_name_with_location', '__return_false' );
    add_filter( 'submit_job_form_prefix_post_name_with_job_type', '__return_false' );

    Additional Examples

    The document provides several advanced examples including appending the Job ID, adding the category to the base URL, and adding both category and region to the URL structure, plus instructions for changing job category and job type slugs.

    WP Job Manager core plugin snippets

    Job Fields

    Prefill the company logo field

    add_filter('submit_job_form_fields', 'dm_prefill_company_logo');
    function dm_prefill_company_logo( $fields ) {
      $fields['company']['company_logo']['value'] = 'full_url_to_the_logo';
      return $fields;
    }

    Mandatory fields

    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields' , 11);
    function custom_submit_job_form_fields( $fields ) {
        $fields['job']['job_location']['required'] = true;
        $fields['job']['job_tags']['required'] = true;
        return $fields;
    }

    Prefill application email

    add_filter('submit_job_form_fields_get_user_data', 'aas_prefill_application_field');
    function aas_prefill_application_field( $fields ) {
      $fields['job']['application']['value'] = 'hello@your-link.com';
      return $fields;
    }

    Remove a field from the job submission page

    add_filter( 'submit_job_form_fields', 'custom_submit_job_form_fields_dm' );
    function custom_submit_job_form_fields_dm( $fields ) {
        unset($fields['job']['job_tags']);
        return $fields;
    }

    Remove all company details from the job submission page

    add_filter( 'submit_job_form_fields', 'gma_custom_submit_job_form_fields' );
    function gma_custom_submit_job_form_fields( $fields ) {
        unset($fields['company']['company_name']);
        unset($fields['company']['company_website']);
        unset($fields['company']['company_tagline']);
        unset($fields['company']['company_video']);
        unset($fields['company']['company_twitter']);
        unset($fields['company']['company_logo']);
        return $fields;
    }

    Change the default Job Type

    add_filter( 'submit_job_form_fields', 'submit_job_form_fields_job_type_default' , 11);
    function submit_job_form_fields_job_type_default( $fields ) {
        $fields['job']['job_type']['default'] = 'volunteer';
        return $fields;
    }

    Prefill the Locations field

    add_filter('submit_job_form_fields', 'bk_prefill_jobs_location');
    function bk_prefill_jobs_location( $fields ) {
      $fields['job']['job_location']['value'] = 'Granite Falls, WA';
      return $fields;
    }

    Redirects

    Use alternative login page

    add_filter( 'login_url', 'my_login_page', 10, 2 );
    function my_login_page( $login_url, $redirect ) {
        return home_url( '/my-custom-login-page/?redirect_to=' . $redirect );
    }

    Redirect to Job Dashboard after job submission

    add_filter( 'job_manager_job_submitted', function() {
        if ( wp_redirect( job_manager_get_permalink( 'job_dashboard' ) ) ) {
    	    exit;
    	  }
    }, 20 );

    Job Listings

    Sort using custom field

    function change_listing_args( $query_args ) {
    	if ( ! empty( $query_args['orderby']['menu_order'] ) ) {
    		$query_args['meta_key'] = '';
    		$query_args['orderby']  = array_merge(
    			array_splice( $query_args['orderby'], 0, 1 ),
    			[ 'meta_value_num' => 'ASC' ],
    			$query_args['orderby']
    		);
    	}
    	return $query_args;
    }
    add_filter( 'get_job_listings_query_args', 'change_listing_args' );

    Disable Job Schema

    add_filter( 'wpjm_output_job_listing_structured_data', '__return_false' );

    Enable excerpts in Job Listing descriptions

    function add_excerpt_support_for_jobs() {
     add_post_type_support( 'job_listing', 'excerpt' );
    }
    add_action( 'init', 'add_excerpt_support_for_jobs' );

    Search

    Make custom meta field searchable

    function my_wpjm_meta_key_dm() {
        global $wpdb, $job_manager_keyword;
        $searchable_meta_keys[] = '_my_meta_field';
        return $searchable_meta_keys;
    }
    add_filter('job_listing_searchable_meta_keys', 'my_wpjm_meta_key_dm');

    WP Admin

    Remove “Listing Expires” column from Job Dashboard

    add_filter( 'job_manager_job_dashboard_columns', 'remove_expires_column' ); 
    function remove_expires_column( $columns ) {
        unset( $columns['expires'] );
        return $columns;
    }

    Geocoding / Geolocation

    Disable Geolocation

    add_filter( 'job_manager_geolocation_enabled', '__return_false' );

    Other

    Enable comments on job listings

    add_filter( 'register_post_type_job_listing', 'register_post_type_job_listing_enable_comments' );
    function register_post_type_job_listing_enable_comments( $post_type ) {
    	$post_type['supports'][] = 'comments';
    	return $post_type;
    }

    Setting up WP Job Manager

    General Settings

    The General tab contains the following settings:

    • Date Format – Choose how you want the published date for jobs to be displayed on the front-end.
    • Google Maps API Key – Enter your Google Maps API key. Google requires an API key to retrieve location information for job listings.
    • Delete Data on Uninstall
    • Bypass Trash for Job Listings
    • Enable Usage Tracking

    Job Listings Settings

    The job listings tab contains the following settings:

    • Listings per page – Controls how many job listings should be shown per page when using the [jobs] shortcode.
    • Pagination Type – Determines whether to show page numbered links or a Load More listings button.
    • Filled positions – If checked, filled positions will no longer be visible.
    • Hide expired listings – If checked, expired job listings are not searchable.
    • Categories – If checked, job categories will be enabled.
    • Types – Choose whether you want to enable types.
    • Salary – If enabled, this lets users add a salary when submitting a job.
    • Location Display – If enabled, displays the full address of the job listing location.
    • Job Visibility – Set the Browse Job Capability and View Job Capability options to user roles.

    Job Submission Settings

    Options regarding the job submission process include:

    • Account required – If unchecked, non-logged in users can submit listings without creating an account.
    • Moderate New Listings – If enabled, new submissions will be inactive pending admin approval.
    • Listing duration – How many days listings are live before expiring.
    • Listing Limits – How many listings users are allowed to post.

    ReCAPTCHA Settings

    WP Job Manager has ReCAPTCHA support built in. You’ll need to set up a ReCAPTCHA key at Google’s ReCAPTCHA admin dashboard and enter your site and secret keys in the CAPTCHA settings page.

    Pages

    The pages tab allows you to select the pages where you’ve inserted the main WP Job Manager shortcodes.

    Multisite

    WP Job Manager can be used on multisite installations. Each subsite requires its own license for add-ons.

    Tutorial: Remove the Resume Preview Step

    Note: All code examples on this site are provided for developer reference/guidance only and we cannot guarantee that they will always work as expected. Our support policy does not include assistance with modifying or debugging code from any code examples, and they may be changed or removed if we find they no longer work due to changes in our plugins.

    To remove the Preview step during the resume submission process, add the following code to a plugin like Code Snippets:

    /**
     * Remove the preview step when submitting resumes.
     * @param  array $steps
     * @return array
     */
    add_filter( 'submit_resume_steps', function( $steps ) {
    	unset( $steps['preview'] );
    	return $steps;
    } );
    
    /**
     * Change button text.
     */
    add_filter( 'submit_resume_form_submit_button_text', function() {
    	return __( 'Submit Resume', 'wp-job-manager-resumes' );
    } );
    
    /**
     * Since we removed the preview step and it's handler, we need to manually publish resumes.
     * @param  int $resume_id
     */
    add_action( 'resume_manager_update_resume_data', function( $resume_id ) {
    	$resume = get_post( $resume_id );
    	if ( in_array( $resume->post_status, array( 'preview', 'expired' ), true ) ) {
    		delete_post_meta( $resume->ID, '_resume_expires' );
    		$update_resume                  = array();
    		$update_resume['ID']            = $resume->ID;
    		$update_resume['post_status']   = get_option( 'resume_manager_submission_requires_approval' ) ? 'pending' : 'publish';
    		$update_resume['post_date']     = current_time( 'mysql' );
    		$update_resume['post_date_gmt'] = current_time( 'mysql', 1 );
    		wp_update_post( $update_resume );
    	}
    } );

    Basically this does a few things:

    1. Remove the preview step
    2. Change preview text to Submit Resume
    3. Manually publish resume (as the preview handler normally does this)

    Google Indexing API for WP Job Manager

    Google Indexing API for WP Job Manager

    A must-have add-on to make sure your jobs are listed first on Google Jobs! This Plugin provides the connection between WP Job Manager and the Google Indexing API.

    The Google Indexing API allows site owners to directly notify Google when pages are added or removed. This enables rapid indexing of job listings for Google for Jobs, ensuring your positions appear in search results quickly.

    For setup instructions and documentation, visit the WP Job Manager documentation site.

    Resume Manager

    Resume Manager

    Resume Manager is a paid plugin for WP Job Manager which provides you with a resume submission form, resume listings, and a candidate dashboard. Resumes created with Resume Manager are used to apply to jobs listed on a WP Job Manager site.

    Installation

    To install this plugin, please refer to the guide here: https://wordpress.org/support/article/managing-plugins/#installing-plugins

    Create Pages with Shortcodes

    After installation, the first thing you’ll need to do is add shortcodes to new pages to create your Resume Manager-specific functionality.

    • [submit_resume_form]: Front-end resume submission form allowing users to submit resumes
    • [candidate_dashboard]: Allows logged-in users to manage, edit, delete, and create resumes
    • [past_applications]: Allows candidates to view past applications (requires Applications plugin)
    • [resumes]: Outputs resumes to a page, visible only to administrators and employers by default

    Settings and Configuration

    The settings page is found in Resumes > Settings.

    Resume Listings

    • Resumes per page display settings
    • Category and skills enablement
    • Resume upload and file deletion options
    • Personal data erasure settings

    Resume Submission

    • Account requirement options
    • Account creation and registration settings
    • Approval and editing workflows
    • Listing duration and auto-hide settings
    • ReCAPTCHA protection

    Candidate Dashboard

    Create a new page and add the [candidate_dashboard] shortcode to allow candidates to access and manage their resumes.

    Resume Visibility

    By default, resumes are visible only to employers and administrators. Configure role-based access restrictions in visibility settings.

    Email Notifications

    Configure admin and employer notifications for new resumes and applications. Customize plain text or rich text email formats.

    The Resume Submission Process

    Step 1 allows users to input resume details including name, contact information, summary, categories, skills, websites, education, and experience. Step 2 provides a preview, and Step 3 shows confirmation upon submission.

    Administrating and Creating Resumes

    Resumes can be approved, edited, viewed, or submitted manually from the Resumes menu in WordPress admin.

    Applying to Jobs with Resumes

    Enable the “Allow candidates to apply to jobs with resumes” setting to let logged-in users apply using their online resume instead of email addresses.

    Troubleshooting

    Ensure latest versions are installed and check for theme/plugin conflicts. For [candidate_dashboard] issues, verify the shortcode is on a page and you’re logged in as a candidate user.

    Resume Manager: Template tags

    the_candidate_location

    the_candidate_location( $map_link = true, $post = null )

    Uses `get_the_candidate_location` and outputs the candidates location including an optional link to google maps.

    the_candidate_title

    the_candidate_title( $before = ”, $after = ”, $echo = true, $post = null )

    Uses `get_the_candidate_title` to output the candidates current or desired job title.

    the_candidate_photo

    the_candidate_photo( $size = ‘full’, $default = null, $post = null )

    Uses `get_the_candidate_photo` to output the candidates photo (or a placeholder).

    the_resume_category

    the_resume_category( $post = null )

    Uses `get_the_resume_category` to output the name of the category the resume was posted in.

    the_resume_status

    the_resume_status( $post = null )

    Uses `get_the_resume_status` to output the resumes current status e.g. active.