Voxel Theme LTD Spring Sale

Youtube shorts embed URL issues

Voxel Theme URL Modifier: Find and Replace Text in URL Path

This Mod is now included natively in the Voxel WordPress Theme. No need to add it. Now called: Replace Text


Embedding YouTube Shorts videos in Elementor and the Voxel Theme requires editing the URL to replace the text ‘shorts’ with ’embed’.

  • YouTube Shorts URLs typically look like this:
    youtube.com/shorts/your-video-id
  • But for embedding YouTube Shorts in your website using Elementor’s video widget, the correct format is:
    youtube.com/embed/your-video-id

But what happens when you’re trying to embed a YouTube Shorts video and the URL format submitted by your users isn’t compatible with the embed requirements?

Using Voxel Theme’s dynamic tag and this custom modifier, you can easily find and replace text in a URL, ensuring your YouTube Shorts URLs are in the proper embed format. This eliminates the need for manual editing of each URL, streamlining your workflow and ensuring that videos display correctly on your site.

In this article, we’ll introduce a new Voxel Mod, Find and Replace URL Modifier that finds your text match and replaces it with your given data.

The Code: Voxel Theme URL Modifier: Find and Replace Text in URL Path

*** Disclaimer – Use at your own risk. Always make a backup. ***

Add to your functions.php file.

         // We got this included natively in the Voxel Theme
         // Now called: Replace Text


To implement this solution, you’ll need to add the code to your WordPress site. You have two options for where to place this code:

  • Child Theme’s functions.php File:

    If you’re already using a child theme (recommended for customization), simply add the PHP code to your functions.php file. This will ensure your changes are preserved even if the main Voxel theme is updated.

  • Code Snippets Plugin:

    If you prefer not to edit theme files directly, or if you want to manage your custom code more easily, you can use the Code Snippets plugin. This plugin allows you to add custom PHP code without touching your theme files. Just create a new snippet, paste the code, and activate it.

Then apply this Voxel Mod to any Video widget in Elementor for the proper embed URL, or apply it to any text or heading widget to display the correct URL path.

Unleash Dynamic Data with Voxel!

With Voxel’s design flexibility, the possibilities are endless. Get Voxel here!

More Articles

A version of this Mod is now included natively in the Voxel WordPress Theme. It is functional but has no customisation options. Called: Abbreviate number. This Mod: Advanced Abbreviate Number offers more options for specifying the abbreviation letter and choosing the number of decimal places shown. Working with large numbers in their raw format can […]
Voxel WordPress Theme number Mods
This guide outlines how to implement Rank Math SEO schema markup within the Voxel WordPress Theme using the free version of Rank Math, enhancing search engine understanding and visibility of your content.   Step 1: Generate Schema MarkupUse an online schema generator to create your schema markup structure. Step 2: Adjust Rank Math SettingsDisable the […]
rank math seo schema markup guide for the voxel theme

Voxel Theme LTD Spring Sale

Support me

Coffee is my fuel

All guides are available for FREE.

If this saved you time, please support my work by checking out the recommended tools or buying me a coffee.