WP Job Manager appends a default subject to all job postings that are being applied over email. The default subject line is generated from the title of the job listing and the URL of the site where the listing has been posted.
So let’s say for instance I have a job listing on this site with the title: WordPress Developer, then WP Job Manager would create a subject line as follows: Application via WordPress Developer listing on https://www.journeybytes.com
While this may be useful to recruiters in pinpointing the origin of their job applications, this subject line may however not be suitable for certain scenarios. Examples include:
- when the job explicitly outlines the subject line to be used
- when you need users to write their own subject
- when you don’t want to include or reveal the URL of your site
Fortunately it is possible to change or do away completely with this subject line.
Remove the Default Subject Line using a Filter
If you only need to change the subject line you can use a localisation plugin like Loco Translate or Poedit as explained by WP Job Manager here to edit the string inside the plugin’s language file.
Alternatively they provide a filter in the same page which we can use to define a custom subject without having to edit the plugin language files. This way you don’t have to worry about losing your edits when you update the plugin.
The snippet that WP Job Manager provides for this task is as follows:
add_filter( 'job_manager_application_email_subject', 'custom_job_manager_application_email_subject', 10, 2 );
// This is your hooked in function. Note: the $post variable is only available after v1.11.2
function custom_job_manager_application_email_subject( $subject, $post ) {
// By default, $subject will contain: Job Application via "X" listing on X. Change that below
$subject = 'New subject';
// Return the new subject
return $subject;
}
Now to completely remove the subject line we only need to make a small change to this filter, namely: leave the subject empty. With this edit the filter will look as follows:
add_filter( 'job_manager_application_email_subject', 'custom_job_manager_application_email_subject', 10, 2 );
// This is your hooked in function. Note: the $post variable is only available after v1.11.2
function custom_job_manager_application_email_subject( $subject, $post ) {
// By default, $subject will contain: Job Application via "X" listing on X. Change that below
$subject = ' ';
// Return the new subject
return $subject;
}
Add the above filter and that should do it. To easily add the filter you can use a plugin like Code Snippets. Should you want to restore the default subject just deactivate or delete the filter.