Skip to content

Commit

Permalink
Merge pull request #53 from brainstormforce/robot-tag-conflicting-wit…
Browse files Browse the repository at this point in the history
…h-yoast

Fix: Robots tags conflicting with Yoast SEO.
  • Loading branch information
patilvikasj authored Mar 25, 2021
2 parents 63806ce + f06b0db commit 28f0f96
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** post, unlist posts, hide posts,
**Requires at least:** 4.4
**Tested up to:** 5.7
**Stable tag:** 1.1.4
**Stable tag:** 1.1.5
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -36,6 +36,8 @@ Need help with something? Have an issue to report? [Get in touch](https://github
Just select option "Unlist Post" in any post of any type and that post will be hidden from the whole site, it can be only accessed if you have the direct link to the post.

## Changelog ##
### 1.1.5 ###
- Fix: Compatibility with Yoast SEO's robots tags options. Robots tags from Unlist Posts will override tag changes from Yoast SEO.

### 1.1.4 ###
- Fix: Due to a bug unlisted posts were visible in the search results, which we have fixed now.
Expand Down
2 changes: 2 additions & 0 deletions class-unlist-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public function no_robots_for_unlisted_posts( $robots ) {
$hidden_posts = get_option( 'unlist_posts', array() );

if ( in_array( get_the_ID(), $hidden_posts, true ) && false !== get_the_ID() ) {
// Disable robots tags from Yoast SEO.
add_filter( 'wpseo_robots_array', '__return_empty_array' );
return wp_robots_no_robots( $robots );
}
return $robots;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hide-post",
"version": "1.1.4",
"version": "1.1.5",
"main": "Gruntfile.js",
"author": "Nikhil Chavan",
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce
Tags: post, unlist posts, hide posts,
Requires at least: 4.4
Tested up to: 5.7
Stable tag: 1.1.4
Stable tag: 1.1.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -36,6 +36,8 @@ Need help with something? Have an issue to report? [Get in touch](https://github
Just select option "Unlist Post" in any post of any type and that post will be hidden from the whole site, it can be only accessed if you have the direct link to the post.

== Changelog ==
= 1.1.5 =
- Fix: Compatibility with Yoast SEO's robots tags options. Robots tags from Unlist Posts will override tag changes from Yoast SEO.

= 1.1.4 =
- Fix: Due to a bug unlisted posts were visible in the search results, which we have fixed now.
Expand Down
4 changes: 2 additions & 2 deletions unlist-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://www.nikhilchavan.com/
* Text Domain: unlist-posts
* Domain Path: /languages
* Version: 1.1.4
* Version: 1.1.5
*
* @package Hide_Post
*/
Expand All @@ -16,6 +16,6 @@

define( 'UNLIST_POSTS_DIR', plugin_dir_path( __FILE__ ) );
define( 'UNLIST_POSTS_URI', plugins_url( '/', __FILE__ ) );
define( 'UNLIST_POSTS_VER', '1.1.4' );
define( 'UNLIST_POSTS_VER', '1.1.5' );

require_once UNLIST_POSTS_DIR . 'class-unlist-posts.php';

0 comments on commit 28f0f96

Please sign in to comment.