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)
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.
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.
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.
Step 3: Activate a Snippet
Now, in the upper right,
- Toggle the Inactive button to Active.
- Click Update.
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.
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.
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.
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.
This post helped you understand how to use the new WP Code integration.
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.