WordPress Integration

Add Text2MySite™ SMS alerts to your WordPress website

Setup time: 3-5 minutes

WordPress, being a flexible and widely used content management system, provides several straightforward ways to embed code and widgets. The best method depends on where you want to place the code and which version of the WordPress editor you are using.

1
Using the Custom HTML Block (Gutenberg Editor)
The easiest and most common way to embed code within a page or post
Recommended for pages/posts

The modern WordPress editor, known as Gutenberg, uses a block-based system. This is the easiest and most common way to embed code within a page or post.

Step-by-Step Instructions:

  1. Add a Block: In the WordPress editor, click the (+) icon to add a new block.
  2. Search for Custom HTML: Search for "Custom HTML" and select the block.
  3. Paste Your Code: Paste your HTML, JavaScript, or widget code directly into the block.
  4. Preview: You can click the "Preview" tab within the block to see how the code will render on your page. This is a great way to ensure the widget is working correctly before you publish.
2
Using Widgets in a Widget Area
For adding code to sidebar, footer, or other widget areas
For widget areas

WordPress themes have designated "widget areas" like the sidebar or footer. You can use a widget to add code to these areas.

Step-by-Step Instructions:

  1. Access Widgets: From your WordPress dashboard, go to Appearance → Widgets.
  2. Add a Custom HTML Widget: On the widgets page, find the "Custom HTML" widget and drag it to the desired widget area (e.g., "Sidebar," "Footer 1," etc.).
  3. Paste and Save: Paste your code into the widget's content box and click "Save" or "Update." The widget will then appear on all pages where that widget area is displayed.
3
Using the Classic Editor
For the older WordPress editor (often enabled via plugin)
For classic editor

If you're using the older, "Classic" WordPress editor (often enabled via a plugin), the process is slightly different.

Step-by-Step Instructions:

  1. Switch to Text Mode: In the post or page editor, find the two tabs above the content box: "Visual" and "Text." Click on the Text tab. This will switch the editor to an HTML view.
  2. Paste Your Code: Paste your embed code directly into the text view where you want the widget to appear.
  3. Save/Publish: Save or publish the page.
4
Using Plugins
For advanced needs and site-wide code insertion
For advanced users

For more advanced needs, or for code that needs to be inserted into the <head> or <body> of your site, a dedicated plugin is the safest and most reliable method. This is essential for things like Google Analytics tracking code or Facebook Pixels.

WPCode:

This is a highly-rated plugin that allows you to manage code snippets for your site. You can create a new snippet, paste your code, and choose where to insert it (e.g., site-wide header, before a post, etc.). This prevents you from having to edit theme files directly.

Insert Headers and Footers:

This is a simpler plugin that provides a clean interface for pasting code into the header or footer of your site, which is perfect for analytics and tracking codes.

YouTube Tutorials
Watch step-by-step video guides for embedding code in WordPress

How To Embed Code In WordPress 2025 🔥 - (FAST & Easy!)

Fast and easy guide for embedding code in WordPress

From WP Cupid Blog - WordPress Tutorials • 1 minute 52 seconds

Watch Tutorial

How To Add HTML Code In WordPress (Quick & Simple)

Quick and simple guide for adding HTML code

From KnowledgeBase • 1 minute 19 seconds

Watch Tutorial