How to visit the website without closing the website for record filing

In the process of submitting our website for the record, we often encounter some websites that already have content, but the record requires that this website cannot be accessed. If the entire website is directly closed at this time, it will have a considerable impact on the weight and traffic of the website. After all, website filing cannot be completed in a day or two.

At this time, you can use a more tricky method, only close the homepage of the website, and the rest of the content pages of the website can be accessed, so that it will not affect the content of the website that the search engine is crawling, and can be submitted through the website.

The webmaster here is built with wordpress , so I will use wordpress as an example to teach you how to close only the home page without closing the entire site.

tutorial

1. In your wordpress website program, find the index.php file of the theme, usually in the following path folder

Path: site -> wp-content -> theme -> zibll

2. Open index.php and copy the following code to the beginning of the file:

 
 

<!-- Hide Home Page-->

<?php if(is_home()) { /* Determine the home page*/ ?>

<script type="text/javascript">

document.title = '404 not found'; /* modify the website title */

</script>

<style type="text/css">

body{display:none !important;}

</style>

<?php } /* Judgment end*/ ?>

<!-- end Hide homepage -->

3. After saving, refresh the homepage of the website, and it will become incapable of opening!

 

おすすめ

転載: blog.csdn.net/m0_71327177/article/details/127698725