SEO Writing Assistant SEMrush Custom Fields

Beschreibung

The SEMrush SEO Writing Assistant plugin read only from post title and post content elements for the real time check.

This plugin allows you to use an arbitrary value for that check in addition to those values.

So, if you are using some kind of a page builders, field managers and so on, you have only to add a little bit of JavaScript code in order to specify which fields.

Note that the plugin don’t replace SEMrush SEO Writing Assistant but is intended to be used together.

Usage

Once the plugin is installed you can configure it programmatically,
by using semrush_seo_writing_assistant_post_types (optional) filter and SeoWritingAssistantSEMrushCustomFields JavaScript object (see below).

API

WordPress Hooks

semrush_seo_writing_assistant_post_types

Filters post types where to enable plugin. Default to array( 'post', 'page', 'product' ).

apply_filters( 'semrush_seo_writing_assistant_post_types', array $post_types )

The filter has the same name as the one used by SEMrush SEO Writing Assistant plugin (since version 1.0.4) used for the same purpose.

JavaScript Event

seo-writing-assistant-semrush

The following example will update text for SEMrush check every 5 seconds, using excerpt and my_custom_fields custom field values (working both with block and classic editors):

jQuery( document ).ready( function() {
    var swa = new SeoWritingAssistantSEMrushCustomFields( { interval: 5 } );
    jQuery( document ).on( 'seo-writing-assistant-semrush', function( event, data ) {
        data.html = jQuery( '#excerpt' ).val() + "\n"
            + jQuery( '.editor-post-excerpt__textarea textarea').val() + "\n"
            + jQuery( '#my_custom_fields' ).val();
    } )
} );

JavaScript API

setHtml()

The following example will update programmatically the text used by SEMrush check with an arbitrary value:

jQuery( document ).ready( function() {
    var swa = new SeoWritingAssistantSEMrushCustomFields( { interval: 0 } );
    swa.setHtml( 'foo baz bar' );
} );

Installation

This section describes how to install the plugin and get it working.

  • Upload the plugin files to the /wp-content/plugins/seo-writing-assistant-semrush-custom-fields directory, or install the plugin through the WordPress Plugins screen directly.
  • Activate the plugin through the Plugins screen in WordPress.

FAQ

Does it work with Gutenberg?

Yes.

Mitwirkende & Entwickler

„SEO Writing Assistant SEMrush Custom Fields“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

Änderungsprotokoll

For SEO Writing Assistant SEMrush Custom Fields changelog, please see the Releases page on GitHub.