Goodbye, Rank Math

 

Today I say goodbye to Rank Math. For a while it was one of the fixed plugins in this house and during its first period it fulfilled its mission with dignity and, to be fair, I must say that it has not caused big problems nor have appeared bugs of those to run in circles waving arms. But things have changed.

Background

If you look for SEO plugin comparisons you will mostly find comparisons between the two most used ones: Rank Math and Yoast. This happens because in many of these comparisons is the interest to place an affiliate link after a positive review in which criticisms are usually avoided for obvious reasons.

After testing its free version for a while, in mid 2021 I started using Rank Math Pro and I have been reviewing some of its new features and changes. Now I have decided to uninstall it and go back to The Seo Framework, mainly for three reasons that I expose in order of importance and that are purely personal appreciations.

1. It is no longer light

It is a fact, it has been getting fatter. Although Rank Math is very complete and is not one of the heaviest plugins (Yoast is even heavier) because you can deactivate those modules that you don't want to use, it has gotten fatter. And this is not good. Loading speed is still one of the main ranking factors for most search engines.

The idea of a "Swiss army knife" plugin that will save you the use of other plugins may be appealing at first until you discover that it consumes less resources even using five, six or more lightweight plugins to do all that Rank Math does.

2. It is no longer cheap

Although this, for some people, will be relative, Rank Math PRO raised its attractive minimum price from $59 to $95.88. That's an increase of $36.88 all at once. A final price almost close to the average cost of a modest hosting. Although the reasons they state for the increase may have their business logic, I consider that this increase could have been progressive for old customers and is too high for their basic license, normally used by bloggers for personal sites with modest or non-existent income.

In their defense, I have to say that when they asked for the reasons for the cancellation they offered me to keep the price I have paid for the last three years with a refund of the difference, but I decided to go ahead with the change because sooner or later the increase would come and because I was more concerned about point 1.

3. Insistence on generative AI

While the new options they added lately were relatively reasonable and useful, they now seem hell-bent on embedding paid AI-based stories to generate content I don't care about and other rather expendable features.

They've even put in AI for the initial automatic responses to their support tickets. Something that I find very lame for a paid service. It is still a clumsy automatism with links to their documentation to "filter" queries that delays the final time of attention and response.

Everything an SEO plugin does can be done without it.

There is absolutely nothing that an SEO plugin does that you can't do on your own with a little bit of code. I would even go as far as to say that you can rank just as well without using any SEO plugin. I've been for a lot of years without using them and I've never suffered any noticeable crashes in my modest, but necessary positioning.

You have to consider these plugins as an aid, a support tool. Never as a solution or a miracle potion.

The first question I always ask myself before installing a plugin is can I do this thing you are announcing without using a plugin? If the answer is yes, I give it a try.

If you prefer not to complicate your life or don't dare, you can use a plugin. But try to choose lightweight plugins that don't sacrifice loading time.

Warning: none of what is stated here should be interpreted as general or universal solutions because they are limited to the specific conditions of my environment. You will have to study yours.

Migrate from Rank Math to The SEO Framework

The Seo Framework is a free plugin created by Sybre Waaijer that has some paid versions with premium extensions and other improvements. Its developers claim that it is "the only SEO plugin that follows Google's webmaster guidelines to the letter".

By not including whistles and whistles, it is much lighter, because it focuses on the necessary basic functions and a noticeable improvement in the performance of both the administration area, the page, as well as in the weight of the DB is immediately noticeable. With the change it has dropped from 623Mb to 448Mb.

The migration process is explained here.

*The logical order for the migration is to install The SEO Framework first WITHOUT disabling OR uninstalling Rank Math because we will need not only to import its data, we will also need it to retrieve data from other functions, if you were using them.

*Before installing The SEO Framework, I advise you to download a copy of your robots.txt in case you have any custom settings as the plugin creates a new one and overwrites it. And if you are looking for how to put breadcrumbs with The SEO Framework, it's here.

You can install it in the traditional way from WP plugin management or by downloading and installing the "Extension Manager" installer from its page. Either way, to import Rank Math data we will need an extension called Transport that is provided in the download. Both methods are explained in its documentation.

When we run Transport, we select Rank Math, what we want to import and run it. The process is fast. This blog already has thousands of entries and the process was completed in less than a minute.

The SEO Framework Transport Extension

The next logical step would be to configure the plugin and uninstall "Extension Manager" and get rid of Rank Math, but first let's go back to Rank Math to download several files that we will need.

The first copies we will save will be the complete configuration files in case we regret it or want to recreate it later to recover something in particular.

We will do this from Rank Math SEO/ Status and tools.

Rank Math Backup

Alternatives for Rank Math functions

Rank Math has a number of functions that The SEO Framework does not have. This is fine in principle, but when the plugin gives problems the bug will spread to all those functions.

These functions will be lost when uninstalling it, so let's make sure to recover them in other ways.

The advantage of this is that, even if we have them separately, we will have more control over them and it will also be easier to solve problems by having them isolated.

Redirections

Rank Math allows you to set up automatic 301 (and other) redirects when you change a URL or delete a post or page. If we have used this tool we will go to the plugin and download a copy of the list of those redirects we made.

From the menu Rank Math SEO/ Redirections/Export we reach the tool"Import and Export". When we click there(1) we find this screen.

Goodbye, Rank Math 2

The options(2) and(3) we will download them only to have two copies in those formats and to be able to recover the redirections manually (if they are not many) or the whole batch with the import tool of the plugin"Redirection" in case something fails or in case we choose to use this plugin instead of putting them by hand in the .htaccess.

The safest option now is(4) because this will write all the redirects you have made from Rank Math to your .htaccess. Once you have clicked on"Synchronize with the .htaccess" navigate to the .htaccess and verify that the redirects have been added, they should appear right at the end of the file as shown in the image below.

Rank Math .htaccess

Tables of contents

The 1.0.104 update of Rank Math, in its free version of December 19, 2022, added a new table of contents block. If we have added tables using this Rank Math block, when we deactivate it, we will be confronted with this text:

"Your site does not include support for the "rank-math/toc-block" block. You can leave this block intact, convert its content to a custom HTML block, or remove it altogether."

Tables of contents missing

The good news is that if you leave it as it is the tables will continue to be displayed, the bad news is that if you try to edit them or remove them you will not be able to add them again. So we leave them as they are for the moment and look for a replacement.

The easiest and quickest option is to pull one of the lightest and most effective plugins I've tried for tables of contents: Simple TOC, as it doesn't add JavaScript or CSS unless the accordion menu is activated.

Table of contents without plugin

If you don't want to use a plugin and prefer to complicate your life a bit, you can try these two methods(1) and(2). I tried both ways and decided to opt for the plugin because some bugs convinced me that the plugin was the fastest, most effective and safest way.

If you do not have many tables you will only have to replace them one by one by hand.

However, if you have many (as it was my case) you can easily locate them. To do this you go to phpMyAdmin, select your database and in the "Search" tab in words or values type "rank-math/toc-block"(1), select "the exact phrase as substring" (2) and the table "wp-posts"(3) and hit "Continue"(4).

Goodbye, Rank Math 5

This will show you a list of all those posts where you added a Rank Math table of contents block, the date the title of the post or page and even the url slug.

Goodbye, Rank Math 6

Now it's time to replace them, in my case I replaced them with a reusable block that I formatted with GenerateBlocks Pro by putting the Simple TOC block inside a container that I styled to match the look of the tables I had placed with Rank Math. You can see the formatting in the table at the top of this post.

Goodbye, Rank Math 7

This way I can automatically insert them where I want and have them displayed, or not, depending on the headers that each post has thanks to GeneratePress Elements, since it is something that the Simple TOC plugin does not allow us to do.

About the native table of contents block in WordPress

This block was added as an experimental block in Gutenberg 13.3.0 in May 2022 and some blogs said then that it would be integrated in WP 6.1, but it was not true. The issue is that someone thought it was removed the "experimental" tag but it did not appear at the time because WordPress 6.1 integrated from version 13.1 to 14.1 and the table of contents is part of Gutenberg 14.4.0. As of today there is no date. So we will have to keep waiting for it to be stable and integrated as part of the core.

The other day I asked in the repository if there was any roadmap on this and this is what Birgit Pauli-Haack answered me.

"The table of contents block is still an ongoing project. There are no timelines available yet for the block to move out of its experimental phase."

If you want to test it, at the moment it can only be done by installing the Gutenberg test plugin.

Image SEO

Módulo de SEO de imágenes de Rank Math

Rank Math has a module called Image SEO. Although not all those who are dedicated to positioning give too much value to this aspect, for a blog like this, with a large volume of vignettes, it is interesting to position images because they generate a not inconsiderable organic traffic that is usually relatively stable.

It's actually a bit of a placebo because what it does is inject the post title into the ALT for the resulting html.

That is, it is applied dynamically only when the content is displayed, the saved content is not modified. It does not fill in the missing ALT fields in WordPress, but it is better than nothing while you are filling in those you left forgotten.

The same can be done with a couple of functions and filters that we will add to the functions.php of our template.

Snippet to add ALT (title of the entry) to all images

//Set the post title as alt text for images in posts and pages. If Alt exists it will do nothing

function add_alt_tags( $content ) {
  preg_match_all( '/<img (.*?)\/>/', $content, $images );
  if ( ! is_null( $images ) ) {
    foreach ( $images[1] as $index => $value ) {
      if ( preg_match( '/alt=""/', $value ) ) {
        $new_img = str_replace(
          'alt=""',
          'alt="' . esc_attr( get_the_title() ) . ' '. $index . '"',
          $images[0][$index] );
        $content = str_replace(
          $images[0][$index],
          $new_img,
          $content );
      }
    }
  }
  return $content;
}
add_filter( 'the_content', 'add_alt_tags', 99999 );

Snippet para añadir ALT (título de la entrada) a la imagen destacada

//Set the title of the entry as ALT of the featured image

function lwp_37481_featured_alt_text($metadata, $object_id, $meta_key, $single) {
    if(isset($meta_key) && $meta_key == '_wp_attachment_image_alt'
        && get_post_thumbnail_id() == $object_id
        && $single === true
    ){
        $original_value = get_post_meta(
            $object_id, '_wp_attachment_image_alt', false
        );
        if(empty($original_value)){
            return get_the_title();
        }
    }
    return $metadata;
}
add_filter('get_post_metadata', 'lwp_37481_featured_alt_text', 10, 4);

Visual tag and category editor

Another curious and interesting option if you position tags (something that SEO's usually discard and even advise not to index them) that can give some joy working it well is that Rank Math added the TinyMCE editor to the categories and tags to be able to add images and give a more attractive format to the text, as if it were a post.

When uninstalling Rank Math the editor disappears, but it can be recovered, also with a couple of functions to place in functions.php.

Warning: for categories, the code works as it should, but for tags it does not hide the old description field and fails to add the caption so, if not added or added as a single paragraph below the image otherwise it works.

Here is the result. On the left the simple native tag editor and on the right the TinyMCE after adding the snippet.

Snippet para las etiquetas:

/* Add TinyMCE editor to tags */

if( is_admin() ) {
// Eliminar filtrado de HTML
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' );
// Agregar nuevo campo de descripcion
add_filter('edit_tag_form_fields', 'filter_wordpress_tag_editor');
function filter_wordpress_tag_editor($tag) {
    ?>
    <table class="form-table">
        <tr class="form-field">
            <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
            <td>
            <?php
                $settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '15', 'textarea_name' => 'description' );  
          wp_editor(html_entity_decode($tag->description , ENT_QUOTES, 'UTF-8'), 'description1', $settings);
            ?>
            <br />
            <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span>
            </td>
        </tr>
    </table>
    <?php
}
// Hide old description field
add_action('admin_head', 'remove_default_tag_description');
function remove_default_tag_description()
{
    global $current_screen;
    if ( $current_screen->id == 'edit-tag' )
    {
    ?>
        <script type="text/javascript">
        jQuery(function($) {
            $('textarea#description').closest('tr.form-field').remove();
        });
        </script>
    <?php
    }
}
}

Y el de las categorías:

/* Add TinyMCE editor to categories */

if( is_admin() ) {
// Eliminar filtrado de HTML
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' );
// Agregar nuevo campo de descripcion
add_filter('edit_category_form_fields', 'filter_wordpress_category_editor');
function filter_wordpress_category_editor($tag) {
    ?>
    <table class="form-table">
        <tr class="form-field">
            <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
            <td>
            <?php
                $settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '15', 'textarea_name' => 'description' );  
          wp_editor(html_entity_decode($tag->description , ENT_QUOTES, 'UTF-8'), 'description1', $settings);
            ?>
            <br />
            <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span>
            </td>
        </tr>
    </table>
    <?php
}
// Hide old description field
add_action('admin_head', 'remove_default_category_description');
function remove_default_category_description()
{
    global $current_screen;
    if ( $current_screen->id == 'edit-category' )
    {
    ?>
        <script type="text/javascript">
        jQuery(function($) {
            $('textarea#description').closest('tr.form-field').remove();
        });
        </script>
    <?php
    }
}
}

*Sorry I don't remember where I found these snippets to give credit to their authors, if I locate them, I will do so.

IndexNow

Rank Math integrated IndexNow in version 3.0.5 in January 2022.

How does IndexNow work?

The protocol works by allowing websites to submit URLs to the IndexNow API once, and it is shared with all participating search engines. Therefore, you only have to submit your site changes and URLs once, and all participating search engines will be aware of the latest changes to your site, to crawl, index and reflect these changes earlier in the search results.

Although using IndexNow does not guarantee that search engines will crawl or index your pages, at least you can be sure that they have received notice of the changes.

SEO does not live by Google alone, there are five search engines participating in IndexNow:

Microsoft Bing, Naver, Seznam.cz, Yandex and Yep

There is no problem to continue using it, for this you have two alternatives.

Use the Microsoft Bing IndexNow plugin that you will find in the WordPress repository. When you install it, an API key is already created. You can leave it on automatic and forget about it. Every time you publish or edit a post it will be sent to IndexNow.

2. Send the URLs manually from the browser as described here. For any other questions, please consult their FAQ.

rel="sponsored"

Although you can still add a nofollow to paid and affiliate links, Google advises adding rel="sponsored" to these types of links.

Rank Math added in its link box the possibility to add this tag with a click.

Goodbye, Rank Math 11

Now there is no choice but to add them manually as it is difficult to find an automated solution that "knows" for sure which links are affiliate links or not.

The structure is like this and it will be enough to edit the block as html to insert the tag.

<a rel="sponsored" href="https://example.com">Link text</a>

Complete uninstallation of Rank Math

Now it's time to kill the plugin. Rank Math offers a filter for complete removal of all Rank Math data.

/**
 * Filter to remove Rank Math data from the database
 */
add_filter( 'rank_math_clear_data_on_uninstall', '__return_true' );

This code must be placed in the rank-math.php file located in the folder of your template (or in the functions.php) and when you return to the list of plugins you will see this message warning that when you deactivate and delete the plugin all data will be erased.

Goodbye, Rank Math 12

Surprise, the data deletion was not such a surprise

Many developers create the plugins in such a way that when you reinstall them you recover part of the last configuration and not all of them have a complete uninstall option. Others promise that the cleanup is complete, but it is not because potatoes.

This data is supposed to be automatically deleted every 30 days, but as you can see in the images below, we still have four tables totaling more than 137 Mb with Rank Math remnants that are more than a year old.

These are four:

wp_actionscheduler_actions
wp_actionscheduler_logs
wp_actionscheduler_claims
wp_actionscheduler_groups

Goodbye, Rank Math 13

To empty these tables I used Advanced Database Cleaner Pro, but you can also do it from phpMyAdmin.

These four tables are created and populated by plugins such as Woocommerce, The Events Calendar, WP Rocket, Rank Math and some others.

If you do not use these plugins you can empty these tables without problems. Anyway, it never hurts to check them and make a backup of the database first or have a recent full backup just in case.

That you make a backup before. Have you already made a backup? Then don't say I didn't warn you.

Goodbye, Rank Math 14

Goodbye, Rank Math 15

Goodbye, Rank Math 16

Once the cleanup is done you will only have to take a look at The SEO Framework configuration to discover that there is very little to change as the basics are preconfigured.

Besides the positive impact on loading speed that uninstalling Rank Math has, another thing I noticed soon after is that the new plugin, which I already used in the past, doesn't need any attention, once it's set up you can forget about it.

Post programado

Programmed post

This is an automatic scheduled summer post. Comments may remain in moderation.

Subscription by e-mail

Receive free full articles in your inbox without advertising as soon as they are published. The full content of the feed is sent ad-free via an external service.