admin管理员组文章数量:1130349
I have created a child theme as per Wordpress recommendation to customize my site.It is working as expected however, I am seeing some Server error (5xx) reports in the Google search console.
It seems that google is trying to index all the php files under the child theme.I am not sure what is reason behind this or how can I stop google to not index anything in the child theme.
I did some research and few people are suggesting to use
if ( ! defined( 'ABSPATH' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die();
}
to block direct access to these files.Is there any other solution to handle this issue in Wordpress?
**Edit**
Here is the style.css
/*
Theme Name:Child
Theme URI:
Template: xxx
Author: Themes
Author URI:
Description:description
Tags: blog
Version: 1.300.08.1520202511
Updated: 2018-03-04 22:28:31
*/
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
// END ENQUEUE PARENT ACTION
// Custom Code
function theme_enqueue_styles() {
wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/css/jdj-custom.css' );
}
//add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 200 );
/**
* For Home page span tag
*/
I have created a child theme as per Wordpress recommendation to customize my site.It is working as expected however, I am seeing some Server error (5xx) reports in the Google search console.
It seems that google is trying to index all the php files under the child theme.I am not sure what is reason behind this or how can I stop google to not index anything in the child theme.
I did some research and few people are suggesting to use
if ( ! defined( 'ABSPATH' ) ) {
header( 'HTTP/1.0 403 Forbidden' );
die();
}
to block direct access to these files.Is there any other solution to handle this issue in Wordpress?
**Edit**
Here is the style.css
/*
Theme Name:Child
Theme URI:
Template: xxx
Author: Themes
Author URI:
Description:description
Tags: blog
Version: 1.300.08.1520202511
Updated: 2018-03-04 22:28:31
*/
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
// END ENQUEUE PARENT ACTION
// Custom Code
function theme_enqueue_styles() {
wp_enqueue_style( 'custom-style', get_stylesheet_directory_uri() . '/css/jdj-custom.css' );
}
//add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 200 );
/**
* For Home page span tag
*/
本文标签: pluginsGoogle trying to index child theme files
版权声明:本文标题:plugins - Google trying to index child theme files 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749038766a2306800.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论