plugins - Google trying to index child theme files

admin2025-06-04  1

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
*/
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749038790a315836.html

最新回复(0)