inc2734 / wp-seo
A library for SEO of WordPress.
Installs: 7 151
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 4
Requires
- php: >=7.4
- inc2734/wp-ogp: ^2.0
Requires (Dev)
- dev-master
- 5.2.3
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.5
- 5.1.4
- 5.1.3
- 5.1.2
- 5.1.1
- 5.1.0
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.0
- 2.0.2
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- dev-dependabot/npm_and_yarn/tough-cookie-4.1.3
- dev-dependabot/npm_and_yarn/shell-quote-1.8.1
- dev-dependabot/npm_and_yarn/ansi-regex-5.0.1
- dev-dependabot/npm_and_yarn/minimist-1.2.8
This package is auto-updated.
Last update: 2024-11-05 13:41:40 UTC
README
This library inputs and saves various settings, but does not output. Please implement the output with your theme.
Install
$ composer require inc2734/wp-seo
How to use
<?php
new \Inc2734\WP_SEO\Bootstrap();
Filter hooks
inc2734_wp_seo_google_analytics_tracking_id
/**
* Google Analytics Tracking ID
*
* @param string $tracking_id
* @return string
*/
add_filter(
'inc2734_wp_seo_google_analytics_tracking_id',
function( $tracking_id ) {
return $tracking_id;
}
);
inc2734_wp_seo_defult_ogp_image_url
/**
* Default og:image
*
* @param string $default_ogp_image_url
* @return string
*/
add_filter(
'inc2734_wp_seo_defult_ogp_image_url',
function( $default_ogp_image_url ) {
return $default_ogp_image_url;
}
);
inc2734_wp_seo_ogp
/**
* When you want to print ogp meta tags, return true
*
* @param bool false
* @return bool
*/
add_filter( 'inc2734_wp_seo_ogp', '__return_true' );
inc2734_wp_seo_meta_robots
This filter hook is deprecated. You can using wp_robots filter hook in WordPress 5.7 or later.
/**
* meta robots
*/
add_filter(
'inc2734_wp_seo_meta_robots',
function( $robots ) {
if ( is_tag() ) {
$robots = [ 'noindex' ];
}
return $robots;
}
);
inc2734_wp_seo_description
/**
* meta description
*/
add_filter(
'inc2734_wp_seo_description',
function( $meta_description ) {
return $meta_description;
}
);
inc2734_wp_seo_google_tag_manager_id
/**
* Google Tag Manager ID
*
* @param string $tag_manager_id
* @return string
*/
add_filter(
'inc2734_wp_seo_google_tag_manager_id',
function( $tag_manager_id ) {
return $tag_manager_id;
}
);
inc2734_wp_seo_use_json_ld
/**
* When you want to print structured data (JSON+LD), return true
*
* @param bool false
* @return bool
*/
add_filter( 'inc2734_wp_seo_use_json_ld', '__return_true' );
inc2734_wp_seo_json_ld
/**
* Structured data (JSON+LD)
*
* @param array $json_ld
* @return array
*/
add_filter(
'inc2734_wp_seo_json_ld',
function( $json_ld ) {
return $json_ld;
}
);
inc2734_wp_seo_twitter_card
/**
* twitter:card
*
* @param string $twitter_card
* @return string
*/
add_filter(
'inc2734_wp_seo_twitter_card',
function( $twitter_card ) {
return $twitter_card;
}
);
inc2734_wp_seo_twitter_site
/**
* twitter:site
*
* @param string $twitter_site
* @return string
*/
add_filter(
'inc2734_wp_seo_twitter_site',
function( $twitter_site ) {
return $twitter_site;
}
);
inc2734_wp_seo_google_site_verification
/**
* Google Site Verification
*
* @param string $google_site_verification
* @return string
*/
add_filter(
'inc2734_wp_seo_google_site_verification',
function( $google_site_verification ) {
return $google_site_verification;
}
);
inc2734_wp_seo_thumbnail
/**
* meta thumbnail
*/
add_filter(
'inc2734_wp_seo_thumbnail',
function( $thumbnail ) {
return $thumbnail;
}
);