1. Home
  2. Developer
  3. How-To Guides
  4. Using Polylang with a Custom Job Board Page

Using Polylang with a Custom Job Board Page

When building a multilingual site with Polylang and Matador Jobs, you may want your job board to live on a custom page rather than the default jobs post type archive. While this setup works well in a single language, there’s an important limitation to be aware of when translations are involved.

Fortunately, Matador Jobs provides a filter that allows you to work around this and ensure the correct job board page is used for each language.

The Problem: Translated Pages and the Job Board Location

When you set a custom page as the Job Board Location in Matador Jobs:

  • Matador saves a reference to that specific page
  • Polylang creates separate pages for each translation
  • The saved setting continues to point to the original page only

This means Matador has no way of automatically knowing which translated page should be used for the current language. As a result, links to the job board (for example from application forms or navigation elements) may always point to the default language page.

The Solution: Filter the Job Board URL by Locale

Matador Jobs exposes a filter that allows developers to modify the URL returned for the job board page:

	    /**
		 * Matador The Jobs Link
		 *
		 * Modify the Jobs URL. For example, to append an anchor.
		 *
		 * @since 3.7.2
		 *
		 * @param string $url
		 * @return string
		 */
		return apply_filters( 'matador_the_jobs_link', $url );

By hooking into this filter, you can detect the current Polylang language and return the URL of the correct translated page instead.

Example Code Snippet

Add the following code to your theme’s functions.php file or a custom plugin:

add_filter( 'matador_the_jobs_link', 'matador_custom_get_url_for_translated_page', 10 );

function matador_custom_get_url_for_translated_page( $url ) {

	if ( ! function_exists( 'pll_get_post' ) ) {
		return $url;
	}

	$post_id              = url_to_postid( $url );
	$translation_id  = pll_get_post( $post_id );
	$translation_url = get_permalink( $translation_id );

	return $translation_url ?: $url;
}

How This Works

  1. Checks if Polylang is active
    If Polylang isn’t installed or enabled, the original URL is returned unchanged.
  2. Finds the original page ID
    The saved job board URL is converted back into a post ID.
  3. Retrieves the translated page
    pll_get_post() returns the appropriate translation for the current language.
  4. Returns the translated URL
    If a translation exists, its permalink is returned. Otherwise, Matador falls back to the original URL.

When to Use This Approach

This solution is recommended if:

  • You are using Polylang
  • Your job board is set to a custom page
  • You want job board links to respect the current language automatically

If you are using the default jobs archive instead of a custom page, this workaround is not required.

Updated on December 22, 2025
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support