---
title: MGID Widget Code Installation on WordPress Websites
description: MGID widget code (Simple JS) is a website-level MGID installation code that publishers use to integrate widgets on a website. Unlike standard installation code, the Simple JS tag is designed to be lig
---

[Skip to content](https://help.mgid.com/how-to-add-widgets-to-wordpress#main-content)

- [English](https://help.mgid.com/how-to-add-widgets-to-wordpress)
- [Bahasa Indonesia](https://help.mgid.com/id/instalasi-kode-widget-mgid-di-situs-web-wordpress)
- [Español](https://help.mgid.com/es/cómo-implementar-el-bloque-de-anuncios-de-mgid-en-wordpress)
- [Français](https://help.mgid.com/fr/installation-du-code-des-widgets-mgid-sur-les-sites-wordpress)
- [Italiano](https://help.mgid.com/it/come-aggiungere-un-widget-mgid-in-wordpress)
- [Polski](https://help.mgid.com/pl/instalacja-kodu-widgetu-mgid-na-stronach-internetowych-wordpress)
- [Português - Brasil](https://help.mgid.com/pt-br/como-adicionar-uma-unidade-de-anúncio-da-mgid-no-wordpress)
- [Tiếng Việt](https://help.mgid.com/vi/cách-để-thêm-widgets-của-mgid-trên-wordpress)
- [Українська](https://help.mgid.com/uk/як-додати-віджет-mgid-у-wordpress)
- [ไทย](https://help.mgid.com/th/วิธีการเพิ่มวิดเจ็ต-mgid-ใน-wordpress)

English

Show submenu for translations

![MGID\_Logo\_Help\_Center\_W\_R\_Swoosh.svg\]](https://help.mgid.com/hubfs/MGID_Logo_Help_Center_W_R_Swoosh.svg)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

Open main navigation

Close main navigation

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)
- - [English](https://help.mgid.com/how-to-add-widgets-to-wordpress)
    - [Bahasa Indonesia](https://help.mgid.com/id/instalasi-kode-widget-mgid-di-situs-web-wordpress)
    - [Español](https://help.mgid.com/es/cómo-implementar-el-bloque-de-anuncios-de-mgid-en-wordpress)
    - [Français](https://help.mgid.com/fr/installation-du-code-des-widgets-mgid-sur-les-sites-wordpress)
    - [Italiano](https://help.mgid.com/it/come-aggiungere-un-widget-mgid-in-wordpress)
    - [Polski](https://help.mgid.com/pl/instalacja-kodu-widgetu-mgid-na-stronach-internetowych-wordpress)
    - [Português - Brasil](https://help.mgid.com/pt-br/como-adicionar-uma-unidade-de-anúncio-da-mgid-no-wordpress)
    - [Tiếng Việt](https://help.mgid.com/vi/cách-để-thêm-widgets-của-mgid-trên-wordpress)
    - [Українська](https://help.mgid.com/uk/як-додати-віджет-mgid-у-wordpress)
    - [ไทย](https://help.mgid.com/th/วิธีการเพิ่มวิดเจ็ต-mgid-ใน-wordpress)

  English
  
  Show submenu for translations
- Contact us

 Contact us

 Welcome to MGID! How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center Home](https://help.mgid.com/?hsLang=en)
2. [Publishers](https://help.mgid.com/publishers?hsLang=en)
3. [Types of integration](https://help.mgid.com/publishers?hsLang=en#types-of-integration)

# MGID Widget Code Installation on WordPress Websites

### Introduction

MGID widget code (Simple JS) is a website-level MGID installation code that publishers use to integrate widgets on a website. Unlike standard installation code, the Simple JS tag is designed to be lightweight and efficient. It ensures minimal impact on site performance and avoids extra steps from the publisher's end.

The installation code shown in this guide is provided for illustrative purposes only. Always copy the installation code generated for your account from your dashboard, as each installation code is unique to your setup. 

Replace {your\_website\_id} and {your\_widget\_id} with the values from Dashboard - Widgets - Get code.

The widget installation code contains two pieces:

1. JS part in the website \<Head\> (website-level script):

**HEAD Part** *(example)***:**

```
<script src="https://jsc.mgid.com/site/{your_website_id}.js" async></script>
```

 2\. Body tag for widget placement (where the widget will be shown):

 

**BODY Part** *(example)***:**

```
<!-- place in the body --> <div data-type="_mgwidget" data-widget-id="{your_widget_id}"></div><script>(function(w,q){w[q]=w[q]||[];w[q].push(["_mgc.load"])})(window,"_mgq");</script>
```

### How to integrate MGID widget code (Simple JS) on WordPress websites

To integrate MGID widget code, which works as a monetization solution on WordPress websites, follow these steps:

1\) Install a free Ad Inserter Plugin from the WordPress website:

- Navigate to the WordPress Plugins menu (​​[https://wordpress.com/plugins](https://wordpress.com/plugins))
- Search for Ad Inserter ([https://wordpress.com/plugins/ad-inserter](https://wordpress.com/plugins/ad-inserter))
- Download and install the plugin
- Activate Ad Inserter on the Plugin dashboard

![wordpress\_1](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_1.png?width=670&height=433&name=wordpress_1.png)

Learn more details about the WordPress Plugins Installation [HERE](https://adinserter.pro/documentation/plugin-installation)

2\) Add the **BODY part** of the MGID widget code in the code placement section of the Ad Inserter plugin:

- Use the Insertion drop-down list to select where widgets should be shown on the website (e.g. after the post)
- Click Save Settings

![wordpress\_2](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_2.png?width=670&height=420&name=wordpress_2.png)

3\) To complete the setup, add the MGID widget code in the **HEAD** of the page:

- Click on the settings icon

![wordpress\_3](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_3.png?width=670&height=545&name=wordpress_3.png)

- Select the Header section
- Paste the Head script

![wordpress\_4](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_4.png?width=670&height=579&name=wordpress_4.png)

- Click on the icon "Enable Insertion of this code into HTML page header."

![wordpress\_6](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_6.png?width=670&height=509&name=wordpress_6.png)

- Save Settings.

If you want to add more widgets, you only have to add the \<body\> code part of a new widget into the next block. Here is an example of the second unit, the impact in-article widget.

![wordpress\_7](https://help.mgid.com/hs-fs/hubfs/1.%20Help%20Center%20(website)/Publishers/WordPress/wordpress_7.png?width=576&height=752&name=wordpress_7.png)

### Video Guide

Click the thumbnail below to access the video guide.

<iframe width="256" height="144.64" src="https://www.youtube.com/embed/3_NFKje1bw8?list=PLTP3I1dve8FIX3XKsGUTUq3fDv5F37S-e" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; border: none;"></iframe>

- [Advertisers](https://help.mgid.com/advertisers?hsLang=en#main-content)

    - [Get started with MGID Ads](https://help.mgid.com/advertisers?hsLang=en#get-started-with-mgid-ads)
    - [Campaign Setup & Management](https://help.mgid.com/advertisers?hsLang=en#campaign-setup-management)
    - [CPA Tune](https://help.mgid.com/advertisers?hsLang=en#cpa-tune)
    - [Conversion tracking: general](https://help.mgid.com/advertisers?hsLang=en#conversion-tracking-general)
    - [Tracking with MGID Pixel](https://help.mgid.com/advertisers?hsLang=en#tracking-with-mgid-pixel)
    - [Postback & Trackers](https://help.mgid.com/advertisers?hsLang=en#postback-trackers)
    - [Affiliate Networks Integration](https://help.mgid.com/advertisers?hsLang=en#affiliate-networks-integration)
    - [Webhook tracking method & Integrations](https://help.mgid.com/advertisers?hsLang=en#webhook-tracking-method-integrations)
    - [Native integrations](https://help.mgid.com/advertisers?hsLang=en#native-integrations)
    - [Ad Creatives Management](https://help.mgid.com/advertisers?hsLang=en#ad-creatives-management)
    - [Campaign Optimization & Performance](https://help.mgid.com/advertisers?hsLang=en#campaign-optimization-performance)
    - [FAQ](https://help.mgid.com/advertisers?hsLang=en#faq)
    - [MGID Video Guides](https://help.mgid.com/advertisers?hsLang=en#mgid-video-guides)
- [Publishers](https://help.mgid.com/publishers?hsLang=en#main-content)

    - [General](https://help.mgid.com/publishers?hsLang=en#general)
    - [Prohibited content and practices](https://help.mgid.com/publishers?hsLang=en#prohibited-content-and-practices)
    - [Types of integration](https://help.mgid.com/publishers?hsLang=en#types-of-integration)
    - [Compliance](https://help.mgid.com/publishers?hsLang=en#compliance)
    - [Payment](https://help.mgid.com/publishers?hsLang=en#payment)
    - [FAQ](https://help.mgid.com/publishers?hsLang=en#faq)
- [Ad Quality Policies and Creative Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#main-content)

    - [Ad Approval & Compliance Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#ad-approval-compliance-guidelines)
    - [Creative AI Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-ai-hub)
    - [Creative Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-hub)
    - [Compliance & Security](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#compliance-security)
- [Advertisers Super Client Account](https://help.mgid.com/advertisers-super-client-account?hsLang=en#main-content)

    - [Clients](https://help.mgid.com/advertisers-super-client-account?hsLang=en#clients)
- [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#main-content)

    - [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#fraud-prevention)
- [API](https://help.mgid.com/api?hsLang=en)
- [DSP](https://help.mgid.com/dsp?hsLang=en)
- [SSP](https://help.mgid.com/ssp?hsLang=en)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

[![Chill listening crop-3](https://help.mgid.com/hubfs/MGID_Logo_Icon_HC.svg "Chill listening crop-3")](https://www.mgid.com)

Native performance through innovation

<https://facebook.com/mgidglobal/> <https://twitter.com/mgid/> <https://www.linkedin.com/company/mgid-inc->

Copyright © 2026, MGID Inc.