August 11, 2023

Include WordPress Page Title Shortcode inside Elementor Hyperlinks

Play Video

Have a look together with Web Squadron on how you can use a WordPress page title shortcode in combination with Elementor and Code Snippets to create Hyperlinks. This can save you a lot of work and time, so let’s get started and find out how it is done.

Introduction to WordPress Page Title Shortcode

Building a website can sometimes feel like constructing a digital city. With numerous neighborhoods (categories) and shops (subcategories), addressing each location can be a challenge. Enter the WordPress page title shortcode, our neat little trick to automate this process.

Understanding the Page Title Shortcode WordPress Challenge

Imagine a sprawling website with 32 categories and 118 subcategories, resulting in 3776 unique hyperlinks. It’s like having a city with thousands of streets but no street signs. The solution? Using the WordPress shortcode page title to generate these signs automatically.

Crafting the Solution: WordPress Shortcode Page Title

The concept is straightforward: use the title of each page as a unique identifier, which then acts as a shortcode for generating hyperlinks.

  1. Give unique Page Names
    Ensure each page on your site has a unique name, like ‘Galway’ or ‘Dublin’. This name acts as a foundation for our shortcode. The slug of the page should also match its title.
  2. Add & Activate the Code Snippet
    We will be using the Code Snippets plugin to add the code below. The snippet, once activated, will transform our page title into a usable shortcode:

    function page_title_shortcode() {
        return get_the_title();
    add_shortcode('page_title', 'page_title_shortcode');

    Source: Code Snippets

  3. Add an Elementor Widget
    Navigate to the page you’re working on and look for a widget you want to insert the link (any widget that allows hyperlink insertion).
  4. Insert Shortcode
    In the widget’s link section, insert the shortcode [page_title]. This will automatically pull the title of the current page.
  5. Insert URL
    Now, click on the advanced section of the shortcode widget. Here, you’ll see a field labeled “Before”. Place your desired link into this “Before” field. This ensures that the page title shortcode is appended correctly to your hyperlink structure.

In Conclusion

With the WordPress page title shortcode, managing hyperlinks becomes less of a chore and more of a streamlined process. It’s all about leveraging the right tools to make your website navigable and user-friendly. So, roll up those sleeves and give this method a whirl!

Friendly Reminder: Always test out new changes on a staging site before going live. Better safe than sorry!

Required Resources

Elementor Logo
Free Options
Credit to Web Squadron
Web Squadron is a popular YouTube channel dedicated to providing informative tutorials, tips, and insights on web development and design. With a strong focus on WordPress and website builders like Bricks Builder, the channel aims to help users of all skill levels, from beginners to advanced developers, create and optimize their websites. By offering easy-to-understand, step-by-step guidance, Web Squadron provides practical and valuable content.
Include WordPress Page Title Shortcode inside Elementor Hyperlinks
Welcome back!
Enter your Helwp credentials to sign in.

No Account yet? Sign Up

My Account
Give Feedback
Describe your feedback *
Rate Helwp
Problem *
Describe the problem
Want us to reply?
Your E-Mail
Affiliate Disclosure

At Helwp, we’re committed to transparency and honesty. Therefore, we want to inform you that some of the links on our website are affiliate links. This means that, at no additional cost to you, we may earn a small commission if you click through and make a purchase.

We only promote products or services that we genuinely believe in. These affiliate commissions help us to maintain the website and continue to provide you with free, high-quality WordPress content.

If you are interested in how you can support us even further, check out our support page.