Help Center

How to Create URL Aliases

How to Create URL Aliases

This tutorial shows how to create URL aliases for the filtered items with the JetSmartFilters WordPress plugin functionality.

Before you start, check the tutorial requirements:

  • Elementor (Free version) or Block editor (Gutenberg)

  • JetSmartFilters plugin installed and activated with a filter created and applied to a page. Learn more about it from this tutorial.

With the URL Aliases feature, you can customize the URL structure on filters with the “Page reload” or “Mixed” Apply type. In other words, you can improve URLs for the website’s search engine optimization and make them prettier for users.

Before you proceed through the tutorial, I recommend reading about the URL Structure Settings to learn about the difference between the “Plain” and “Permalink” options and how to fix some URL-related issues.

Filter URL Structure

When you filter items with the filters with the “Page reload” or “Mixed” Apply type, it may contain such a part in the URL: ‘jsf/jet-engine/tax/vacancy-type:14’, where:

  • jsf – JetSmartFilters;
  • jet-engine – shows provider for filters. Besides JetEngine, it can be Elementor Pro (e.g., epro-portfolio), JetWooBuilder (e.g., jet-woo-products-grid), or WooCommerce (e.g., woocommerce-shortcode);
  • tax – shows that the filter uses taxonomy as the data source. It changes depending on the option you selected in the Data Source when creating the filter;
  • vacancy-type:14 – “vacancy-type” is the category slug, and “14” is the category ID.
Warning

The main aliases purpose is to change the jsf and part that indicates the filter provider (e.g., jet-engine). You can change such parts as category slugs, as it is shown further, but be careful.

filtered URL structure

How URL Aliases Work

Proceed to the JetSmartFilters > Settings tab on the WordPress Dashboard, open the URL Structure Settings tab, and turn the Use URL Aliases toggle on.

jetsmartfilters URL structure settings

The enabled toggle adds a repeater with two fields inside: the Needle (first field), where you can enter a value from a URL string that you want to replace, and the Replacement (second field), where you can enter a value that replaces it in the URL.

To find out what you can enter into the Needle field, proceed to the front-end page with a filter that has the “Page reload” or “Mixed” Apply type and apply the filter. 

filters on the front end

After the page reloaded, I copied the /jsf/jet-engine/ part to replace it.

filtered URL

Place the copied part into the Needle field, and enter the value which you want to replace it with into the Replacement field. To save changes, press the Enter key or remove focus from the input field and wait until the Settings have been saved pop-up appears.

needle and replacement

If you enable the See how the aliases will look toggle, you can see how changes occur in the URL during direct and reverse transformation.

see how the aliases will work

Return to the front end, reload the page, and apply the filter again. As you can see, the URL part was replaced.

URL alias
Warning

Be aware that if an URL doesn’t contain JetSmartFilters keys such as /jsf/, ?jsf=, &jsf=, then aliases will not be applied, even if the URL part matches with the Needle field.

How to Apply Aliases only on the Certain Pages

You can copy the URL part, which includes the page or archive slug.

URL with page slug

If the Needle and Replacement fields contain a page slug, URL aliases will be applied only on that page.

page slug

How to Apply Aliases to Filtered URLs with Terms

If you have a filter with a taxonomy as the data source, you can change the taxonomy slug to a shorter and more convenient alias.

Apply the filter with terms to show items of a specific category or tag, copy the term slug you want to replace, and enter it into the Needle field.

filtered URL with term slug

Type the Replacement for the term slug.

Warning

Ensure not to use category, post, or other slugs in the Replacement fields.

alias for term slug

Proceed to the front end, reload the page, and apply the filter again to check the changes.

filtered URL with an alias for term slug

How to Avoid Errors

If you have the After reverse transformation, the URL does not match the incoming value. Check uniqueness of keys error, make sure the next Needle fields don’t contain parts from the Replacement fields. For example, you should write /jet-engine/ in Needle and /j-filter/ in Replacement fields instead of dividing the alias into two parts, as in the screenshot.

сheck uniqueness of keys error

Also, we recommend entering the filtered URL without aliases copied from the front end in the preview line; it helps to identify such errors in aliases for your filters more effectively. To change it, hit the pencil icon, and to save the URL preview, click the tick icon. To decline changes, hit the rollback icon. Then, you can copy some URL parts from this line and replace them with aliases using the Needle and Replacement fields. When you finish with one URL, you can enter another one.

filtered URL in the preview line
Warning

We don’t recommend applying aliases on the URL parts containing IDs since some elements

Also, the longer the URL part you’ll try to rename (e.g., /jsf/jet-engine/tax/vacancy-location), the more likely it is to get an error since some URL parts can be changed according to the filter settings.

That’s all. Now you know how to create URL aliases for the filtered items with the JetSmartFilters WordPress plugin functionality.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.