> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Snippets Overview

> WordPress Code Snippets for MainWP is a simple way to add code snippets to your Child Sites from one centralized location. No need to manually edit your theme's functions.php file or wp-config.php file.

<div id="addon-data" style={{display: 'none'}} data-title="Code Snippets" data-purchase-url="https://mainwp.com/extension/code-snippets/" data-pricing-tier="pro" data-bundle="MainWP Pro" data-addon-type="extension" data-version="5.1" data-developer="MainWP" data-changelog-url="https://mainwp.com/changelog/mainwp-code-snippets-extension/" data-owned-by="Jestart LLC" data-privacy-url="https://mainwp.com/mainwp-plugin-privacy-policy/" />

## What You'll Learn

* Understanding the three code snippet types
* Executing and saving code snippets
* Removing snippets from child sites
* Recovering from bad snippets
* Useful wp-config.php snippets

***

<Info>
  **Extension Add-on** - This add-on provides standalone functionality within MainWP Dashboard. No third-party plugins required.
</Info>

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/Bl7rJzGmNU0" title="Code Snippets - Video Tutorial" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

The [MainWP Code Snippets Extension](https://mainwp.com/extension/code-snippets/) is a simple way to add code snippets to your child sites from one centralized location. A code snippet is a small chunk of PHP code sent to your child sites, saved on your child sites, or written to `wp-config.php`, depending on the snippet type. Sometimes they contain full functions; other times, they modify an existing function.

<Warning>
  **This tool is recommended for advanced users only.** We only recommend utilizing it if you are an experienced PHP coder.
</Warning>

## Code Snippet Types

The MainWP Code Snippets Extension allows you to run code in three ways:

<AccordionGroup>
  <Accordion title="Execute on Child Sites" icon="play" defaultOpen>
    This type of snippet will save the snippet in your child site database and execute it when the child site loads. You would use this option to make actual changes to your child sites. For example, if you wanted to customize the admin footer across different sites in your network, you would use this option.
  </Accordion>

  <Accordion title="Return info from Child Sites" icon="arrow-right-from-bracket">
    This type of snippet will get the info from child sites and display it in the Console output. This type of snippet will not be saved on your child sites. This option queries the child and returns the information to you. An example would be if you wanted to know the published post count of all of your sites.
  </Accordion>

  <Accordion title="Save to wp-config.php" icon="file-code">
    This type of snippet will be added to your child site's `wp-config.php` file and saved only in that file. One of the most important files in your WordPress installation is the `wp-config.php` file. A code snippet in this section allows you to do things such as increase WordPress memory, block external requests, disable WP-Cron, and much more.
  </Accordion>
</AccordionGroup>

<Warning>
  MainWP is not responsible for the code that you run on your sites. Use this tool with extreme care and at your own risk. Run any code on a test site before releasing it on live sites. If you execute a bad code snippet and crash your child sites, you need to remove the code snippet from your sites.
</Warning>

## Remove a Code Snippet From a Broken Site

Code snippets can be removed directly from the database. To do this:

<Steps>
  <Step title="Log in to your cPanel, locate phpMyAdmin, and open your site database" />

  <Step title="Locate and open the site's options table">
    The default table name is `wp_options`, but the prefix may be different on your site.
  </Step>

  <Step title="Remove the Code Snippets option rows">
    Locate and remove the `option_name = mainwp_ext_snippets_enabled` row, or the `option_name = mainwp_ext_code_snippets` row.
  </Step>
</Steps>

**This will remove all database-saved code snippets that were applied using our Code Snippets extension.** If you use bad snippets that are saved to `wp-config.php`, the file will need to be edited manually.

## Execute a Code Snippet

### Execute a New Code Snippet

<Steps>
  <Step title="Log in to your MainWP Dashboard" />

  <Step title="Go to the MainWP > Add-ons > Administrative > Code Snippets > Execute Snippet page">
    Go to the **MainWP > Add-ons > Administrative > Code Snippets > Execute Snippet** page<img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=2416e038804dfa9ab03c731fec920515" alt="MainWP Code Snippets > Snippet Options" data-og-width="1703" width="1703" data-og-height="890" height="890" data-path="images/add-ons/code-snippets-options.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=3e0c358b72f1ec7e9efc3247fed396ef 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=f2b4d779fc57e7f4fdc4f1624468b133 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=d6cbb6021c426eab8a0caf11394e68ff 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=bb138e0a082134c2ebeba6913ed66cdc 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=bc03f3f4eb3dea1a701affb7532fc408 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=6d1c535a45672f2fca7ef06799851df7 2500w" />
  </Step>

  <Step title="Enter a Snippet Title" />

  <Step title="Enter a Snippet Description (optional)" />

  <Step title="Select the snippet type" />

  <Step title="Select Child Sites where you want to execute the snippet">
    [Select Child Sites](/getting-started/mainwp-user-interface) where you want to execute the snippet **NOTE:** A snippet cannot be executed on both the selection of Sites and a selection of Tags. If it is already executed to either Sites or Tags, and you choose the other selection type, it will be removed from the existing selection.
  </Step>

  <Step title="Add your Code Snippet in the code editor">
    Add your Code Snippet in the code editor <img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=33832f734cbe377d118650a47f4f34be" alt="MainWP Code Snippets > Code Editor" data-og-width="1374" width="1374" data-og-height="599" height="599" data-path="images/add-ons/code-snippets-editor.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=ec2356d2d3e6e754e75f8272a98dc461 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=2ba11d74c5b4a8f02199f0fd64d01474 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=1c2f60e4730045f912921ac249188626 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=c896c7810d7ae8e2f8d612870f746e42 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=1928a5681a98e7e3786235d8889b5f53 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=e63f70a0ec5725a2f09e9bd931c4a746 2500w" />
  </Step>

  <Step title="Click the Save & Execute Snippet button" />
</Steps>

### Execute a Saved Code Snippet

<Steps>
  <Step title="Log in to your MainWP Dashboard" />

  <Step title="Go to the MainWP > Add-ons > Administrative > Code Snippets > Saved Snippets page" />

  <Step title="Locate the Code Snippet that you want to execute" />

  <Step title="Click the Load button">
    Click the **Load** button <img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=ca065444d3b2e8c035386b77490f391f" alt="MainWP Code Snippets > Load Snippet" data-og-width="1720" width="1720" data-og-height="610" height="610" data-path="images/add-ons/code-snippets-load.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=5c6ec88ec57daa0311478f4758125134 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=a28cc3328ca235f40afbaeb08df04f48 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=5b42d002864a2106566f6da0e172e972 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=18ada19c3ca13c8c65abfaf2795801a2 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=586cb82b45388349fb0924fbfee8706a 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=30e043925dc6b4cae03b5b6859eb5fc3 2500w" />
  </Step>

  <Step title="Once the Code Snippet loads, click the Save & Execute Snippet button" />
</Steps>

## Save a Code Snippet

### Save a New Code Snippet

<Steps>
  <Step title="Log in to your MainWP Dashboard" />

  <Step title="Go to the MainWP > Add-ons > Administrative > Code Snippets > Execute Snippet page">
    Go to the **MainWP > Add-ons > Administrative > Code Snippets > Execute Snippet** page<img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=2416e038804dfa9ab03c731fec920515" alt="MainWP Code Snippets > Snippet Options" data-og-width="1703" width="1703" data-og-height="890" height="890" data-path="images/add-ons/code-snippets-options.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=3e0c358b72f1ec7e9efc3247fed396ef 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=f2b4d779fc57e7f4fdc4f1624468b133 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=d6cbb6021c426eab8a0caf11394e68ff 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=bb138e0a082134c2ebeba6913ed66cdc 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=bc03f3f4eb3dea1a701affb7532fc408 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-options.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=6d1c535a45672f2fca7ef06799851df7 2500w" />
  </Step>

  <Step title="Enter a Snippet Title" />

  <Step title="Enter a Snippet Description (optional)" />

  <Step title="Select the snippet type" />

  <Step title="Select Child Sites where you plan to save the snippet">
    [Select Child Sites](/getting-started/mainwp-user-interface) where you plan to save the snippet **NOTE:** A snippet cannot be saved on both the selection of sites and a selection of tags. If it is already saved to either sites or tags, and you choose the other selection type, it will be removed from the existing selection.
  </Step>

  <Step title="Add your Code Snippet in the code editor">
    Add your Code Snippet in the code editor <img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=33832f734cbe377d118650a47f4f34be" alt="MainWP Code Snippets > Code Editor" data-og-width="1374" width="1374" data-og-height="599" height="599" data-path="images/add-ons/code-snippets-editor.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=ec2356d2d3e6e754e75f8272a98dc461 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=2ba11d74c5b4a8f02199f0fd64d01474 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=1c2f60e4730045f912921ac249188626 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=c896c7810d7ae8e2f8d612870f746e42 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=1928a5681a98e7e3786235d8889b5f53 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-editor.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=e63f70a0ec5725a2f09e9bd931c4a746 2500w" />
  </Step>

  <Step title="Click the Save Snippet button" />
</Steps>

### Edit a Saved Code Snippet

<Steps>
  <Step title="Log in to your MainWP Dashboard" />

  <Step title="Go to the MainWP > Add-ons > Administrative > Code Snippets > Saved Snippets page" />

  <Step title="Locate the Code Snippet that you want to edit" />

  <Step title="Click the Load button">
    Click the **Load** button <img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=ca065444d3b2e8c035386b77490f391f" alt="MainWP Code Snippets > Load Snippet" data-og-width="1720" width="1720" data-og-height="610" height="610" data-path="images/add-ons/code-snippets-load.jpg" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=280&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=5c6ec88ec57daa0311478f4758125134 280w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=560&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=a28cc3328ca235f40afbaeb08df04f48 560w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=840&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=5b42d002864a2106566f6da0e172e972 840w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=1100&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=18ada19c3ca13c8c65abfaf2795801a2 1100w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=1650&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=586cb82b45388349fb0924fbfee8706a 1650w, https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-load.jpg?w=2500&fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=30e043925dc6b4cae03b5b6859eb5fc3 2500w" />
  </Step>

  <Step title="Once the Code Snippet loads, edit wanted details" />

  <Step title="Click the Save Snippet button" />
</Steps>

## Remove a Code Snippet From Child Sites

<Steps>
  <Step title="Log in to your MainWP Dashboard" />

  <Step title="Go to the MainWP > Add-ons > Administrative > Code Snippets > Saved Snippets page" />

  <Step title="Locate the Code Snippet that you want to remove from your child sites" />

  <Step title="Click the Load button" />

  <Step title="Once the Code Snippet loads, unselect child sites where you want to remove the snippet">
    Once the Code Snippet loads, unselect child sites where you want to remove the snippet
  </Step>

  <Step title="Click the Save & Execute Snippet button." />
</Steps>

This process will remove the snippet from all child sites and re-add it only on sites that are still selected. This method is recommended in case you want to keep your snippet saved in the Saved Snippets list so it can be used again in the future. If you want to remove the snippet from all child sites, you can uncheck all sites and click the **Save & Execute Snippet** button.

## Useful Code Snippets

MainWP is not responsible for the code that you run on your sites. Use this tool with extreme care and at your own risk. It is recommended that you run any code on a test site before releasing it on live sites. In case you damage your site by using a bad code snippet, read [Remove a Code Snippet From a Broken Site](#remove-a-code-snippet-from-a-broken-site) to see how to fix it.

### Delete rows in the wp\_mainwp\_stream\_meta and wp\_mainwp\_stream tables

This can be useful if the wp\_mainwp\_stream\_meta and wp\_mainwp\_stream tables have grown large in size. To prevent them from growing this large in the future, consider lowering the number of days for which the records are kept. **NOTE:** This will delete all records in these two tables, which means that the Pro Reports reports will not have any information about events prior to this deletion.

*When running the script, make sure to select **Return info from Child Sites**.*

```php theme={null}
global $wpdb;
$wpdb->query( "TRUNCATE TABLE {$wpdb->mainwp_stream}" );
$wpdb->query( "TRUNCATE TABLE {$wpdb->mainwp_streammeta}" );
```

### Change the value of "Keep Records for" in MainWP Child Reports plugin

<img src="https://mintcdn.com/mainwp/2l_gbp8O-WEhKcrd/images/add-ons/code-snippets-return-info.png?fit=max&auto=format&n=2l_gbp8O-WEhKcrd&q=85&s=9a89024d1cda074e8ff43a5934ee8042" alt="Code Snippets execute action with Return info from Child Sites option" width="1562" height="518" data-path="images/add-ons/code-snippets-return-info.png" />

*When running the script, make sure to select **Return info from Child Sites**.*

```php theme={null}
global $wpdb;

$option = get_option( 'wp_mainwp_stream' );

if ( $option && isset( $option['general_records_ttl'] ) ) {
    $option['general_records_ttl'] = 31; // New desired value (e.g., 30 days)
    update_option( 'wp_mainwp_stream', $option );
}
```

### Disable theme, plugin editor and plugin, core updates

*This snippet goes to the **wp-config.php** file of your child sites. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define('DISALLOW_FILE_EDIT',true); // theme, plugin
define('DISALLOW_FILE_MODS',true); // core, plugin
```

### Disable CRON job feature

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define('DISABLE_WP_CRON', true);
```

### Set auto-save interval

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define('AUTOSAVE_INTERVAL', 200);
```

### Block external requests

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define('WP_HTTP_BLOCK_EXTERNAL', true);
```

This snippet blocks outbound HTTP requests. It can also prevent WordPress, plugin, and theme update checks unless you allow the required hosts.

### Increase WordPress memory limit

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define('WP_MEMORY_LIMIT', '95M');
```

### Enable Debug Mode

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define( 'WP_DEBUG', true );
```

### Disable All Core Updates

*This snippet goes to the **wp-config.php** file of your site. Be sure to select the correct third option when using the code snippet.*

```php theme={null}
define( 'WP_AUTO_UPDATE_CORE', false );
```

### Protect WordPress against malicious URL requests

*Use the **Execute on Child Sites** option when executing this snippet. The extension saves this snippet in the child site's database and runs it when the child site loads.*

```php theme={null}
global $user_ID; if($user_ID) {
        if(!current_user_can('administrator')) {
                if (strlen($_SERVER['REQUEST_URI']) > 255 ||
                        stripos($_SERVER['REQUEST_URI'], "eval(") ||
                        stripos($_SERVER['REQUEST_URI'], "CONCAT") ||
                        stripos($_SERVER['REQUEST_URI'], "UNION+SELECT") ||
                        stripos($_SERVER['REQUEST_URI'], "base64")) {
                                @header("HTTP/1.1 414 Request-URI Too Long");
                                @header("Status: 414 Request-URI Too Long");
                                @header("Connection: Close");
                                @exit;
        }
    }
}
```

Source: [WPSnip.com](http://wpsnip.com/)

***

## Related Resources

* [Administrative Add-ons](/add-ons/administrative) - Browse administrative tools
* [Detect the Essential Plugin wp-config.php compromise](/add-ons/development/detect-wpos-analytics-wp-config-compromise) - Use a read-only snippet to check child sites for known compromise indicators
* [White Label Extension](/add-ons/agency/white-label-extension) - Deploy filters to child sites
* [Bulk Settings Manager](/add-ons/administrative/bulk-settings-manager-extension) - Manage plugin settings
