aioseo wpcode snippet library

How to Use the New AIOSEO Code Library (WPCode Integration) – WordPress Tutorial

Would you like to customize All in One SEO (AIOSEO)? Our world-class engineers have created code snippets that do just that.

Until now, this custom code wasn’t available to the public. But thanks to the new integration with WPCode, you can now customize AIOSEO with a few button clicks.

In this tutorial, you’ll learn how to use this new snippet library to add new functionality to AIOSEO.

Step 1: Download All in One SEO (AIOSEO)

First, if you haven’t done so already, download and install All in One SEO.

All in One SEO (AIOSEO) is an established plugin with thousands of 5-star ratings on WordPress.org and over 3 million users.

After you’ve uploaded the plugin to your WordPress site, a setup wizard will open and walk you through a few steps.

aioseo homepage

Step 2: Navigate to the Code Snippet Library

Next, in the WordPress admin bar, go to AIOSEO » Tools » Code Snippets

If you don’t already have WPCode installed, you’ll see a prompt to install it. You can get the plugin for free.

Now, in AIOSEO, you’ll see the code snippets.

aioseo code snippets

Currently, there are 14 code snippets to choose from.

For our tutorial, we’ll choose Limit Meta Description to 160 Characters.

This code snippet truncates your meta descriptions, site-wide, to 160 characters. It does this in the HTML code of each web page.

To get started, click the blue Use Snippet button. That will open a new window.

aioseo meta description code snippet

Step 3: Activate a Snippet

Now, in the upper right,

  1. Toggle the Inactive button to Active.
  2. Click Update.
activate aioseo meta description code snippet

That’s all you need to do. The code snippet is now active.

To deactivate a code snippet, simply toggle the button back to Inactive and click the blue Update button again.

The AIOSEO team will continue to add more snippets to the library.

Optional: Customize Insertion

The default insertion for the code snippet is for it to be automatically inserted (“Auto Insert) on all pages (“Run Everywhere”) and all device types.

edit aioseo code snippet

The default settings will meet most users’ needs. But you can customize these settings.

Insert Method: Instead of Auto Insert you can choose Shortcode to add the snippet manually to select pages.

Location: If you choose Auto Insert, you’ll get a variety of options to choose from in the Location drop-down. These include

  • Front-end only
  • Admin only
  • Site-wide header, footer, or body

You can also choose the location based on HTML elements and CSS selectors if you’re using WPCode’s Pro Version.

Schedule snippet: You can also use a date picker to schedule the snippet to run for a specified time frame. (Requires WPCode Pro.)

Device types: Scroll down a bit further in the window and you’ll see an option to limit the device types your code snippet will be active on.

aioseo code snippets device type options

Smart conditional logic: You can also choose to show or hide your code snippet on pages based on conditions, like

  • The page URL
  • Whether a user is logged in
  • The user’s role
  • Type of page (Post type, Referrer, etc.)
  • WooCommerce page
  • Easy Digital Downloads page
  • MemberPress page
  • and more.
aioseo code snippets conditional logic

How to Access AIOSEO Code Snippets in WPCode

You can also access our code snippets directly from WPCode.

If you have WPCode installed, go to WPCode » Library.

You’ll see a button at the bottom left for AIOSEO’s code snippets.

wpcode menu aioseo item
When you open WPCode, look under Library to see AIOSEO as a menu item. (Enlarged here.)

What’s Next?

This post helped you understand how to use the new WP Code integration.

Next, explore how to add breadcrumb navigation in WordPress and learn how to turn your web pages into rich snippets. And don’t forget to capture leads.

If you found this article helpful, please subscribe to our YouTube Channel. You’ll find many more helpful tutorials there. You can also follow us on Twitter, LinkedIn, or Facebook to stay in the loop.

Want to Try AIOSEO for Free?

Enter the URL of your WordPress website to install AIOSEO Lite.

Please enable JavaScript in your browser to complete this form.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.

author avatar
Sherrie Gossett Content Writer
Sherrie is an SEO analyst based in New Hampshire in the United States. When she’s not busy researching, implementing, and writing about new SEO developments, she can be found hiking and playing guitar.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.