Wordpress:更改机器人元标记

时间:2016-05-11 17:26:50

标签: php html wordpress

我想知道,有没有办法覆盖Wordpress与wp_head()函数一起放置的漫游器元标记。出于某种原因,我无法取消选中“#34;阻止搜索引擎索引此网站" (当我取消选中该框并保存设置时,页面会重新加载并再次检查该框。)

我找到了将元标记放在wp_includes文件夹中的功能,但我不想更改核心中的任何内容,所以我想知道它是否可以在任何其他方式。

谢谢!

编辑:我尝试停用所有插件,但没有解决复选框问题。

2 个答案:

答案 0 :(得分:2)

使用名为head-cleaner的wordpress插件,它允许您编辑$product = Product::first(); // assume you've defined this already $uploadedImages = $request->file('images'); // get the images $destinationPath = storage_path . '/uploads'; // somewhere to put your images foreach ($uploadedImages as $uploadedImage) { // upload the image first! if ($uploadedImage->isValid()) { $extension = $uploadedImage->getClientOriginalExtension(); // file extension $uploadedImageName = uniqid(). '.' .$extension; // unique file name with extension $uploadedImage->move($destinationPath, $uploadedImageName); // move file to our uploads path // create ScenesImages record in DB $image = ScenesImages::create([ 'name' => $uploadedImageName, // assuming this is your file path? 'scenes_images' => '' // assign something here, not sure what it's supposed to be? ]); // associate product $image->product()->associate($product); } else { // handle error here } } 功能的输出。

  

清理WordPress页眉和页脚中的标签。

要手动编辑,请打开wp_head() 并搜索函数wp-includes/general-template.php

答案 1 :(得分:0)

也许你的一些插件超出了正常的行为。我会禁用所有插件,没有必要的插件,看看禁用该复选框后会发生什么。