How To Enqueue External Scripts On WordPress

When building a WordPress website, there are many occasions when we need to link to external scripts, for example:

  • CDNs for fonts (font-awesome, Adobe Typekit, Google Fonts)
  • Links for plugin scripts or 3rd party embedded scripts
  • Higher-level features like Google Maps

It is always easy to hardcode the link into the header.php file, however, that is not best practice when it comes to WordPress. WordPress comes with a powerful enqueue feature that comes equipped with version control, dependencies and other features.

Paste the above script into your functions.php (or ditch the function, and just copy the enqueue line if you already have an enqueue function), change the URL, and you’re done.

You can also set dependencies if you wish — for more information, please visit the official WordPress documentation.

Unsure of where to insert this? Don’t want to break anything? Our team of WordPress developers in Singapore can accomplish this job for you safely and efficiently. We are highly experienced in WordPress and web development and are equipped in solving any issues you might be facing.

Do note that this guide is purely for enqueuing external scripts on WordPress. For other WordPress functions, please contact us if you need help. Our team of WordPress developers in Singapore will be happy to assist you!

oangledes

Recent Posts

Turning Website Visitors Into Loyal Customers

Discover how thoughtful web design and user experience strategies can transform first-time visitors into loyal…

2 weeks ago

Building Trust Through Modern Website Design

Trust is a critical factor in online conversions. Learn how modern website design builds credibility…

3 weeks ago

Crafting High-Impact Landing Pages That Drive Results

Landing pages are designed for one purpose: conversion. Learn how to craft focused, impactful landing…

3 weeks ago

The Hidden Power of White Space in Web Design

White space is often mistaken for empty space, but in web design it plays a…

1 month ago

Designing Digital Experiences That Convert in Seconds

Users today decide within seconds whether a website deserves their attention. Designing digital experiences that…

1 month ago

High-Fidelity vs Low-Fidelity Prototypes: When To Use Which

Prototyping is an essential step in UX design, but not all serve the same purpose.…

2 months ago