【问题标题】:How to remove dynamically inserted code in my WordPress site?如何删除我的 WordPress 网站中动态插入的代码?
【发布时间】:2017-12-25 21:53:40
【问题描述】:
<div style="position: absolute; top: -136px; overflow: auto; width:1241px;">
<h3><strong><a style="font-size: 11.335pt;" href="http://2giadinh.com/thoi-trang">thời trang 
trẻ em</a></strong>
<strong><a style="font-size: 11.335pt;" href="http://themestotal.com">Wordpress Themes
 Total Free</a></strong>
<em><a style="font-size: 10.335pt;" href="http://2xaynha.com">tư vấn xây nhà</a></em>
<em><a style="font-size: 10.335pt;" href="http://lanakid.com">thời trang trẻ em</a></em>
<em><a style="font-size: 10.335pt;" href="http://2giaynu.com">shop giày nữ</a></em>
<em><a href="http://magentowordpresstutorial.com/wordpress-tutorial/wordpress-plugins">download
 wordpress plugins</a></em>
<em><a href="http://2xaynha.com/tag/mau-biet-thu-dep">mẫu biệt thự đẹp</a></em>
<em><a href="http://epichouse.org">epichouse</a></em>
<em><a href="http://fsfamily.vn/tag/ao-so-mi-nu">áo sơ mi nữ</a></em>
<em><a href="http://en.2xaynha.com/">House Design Blog - Interior Design and 
Architecture Inspiration</a></em></h3>
</div>

我试过了:

setTimeout(function () {
    $('a[href="http://themestotal.com"]').closest('div').remove()
}, 2000);

没用!

试过了:

编辑您的functions.php.. 查找包含wp_footer 的代码(因为您尝试删除的代码位于那里)。

但没有base64_decode 代码查找!

已检查 .htaccess、wp-config.php、index.php、footer.php、header.php 和 option.php 文件。

【问题讨论】:

  • 那么您要删除那个(链接)&lt;a&gt; 还是整个 div?
  • 不要尝试使用 JavaScript 删除该代码。找到代码的来源(恶意软件?)并正确删除(也就是从 PHP 中删除)。
  • 由于 WordPress 网站上动态添加的代码,我无法更正其在相应文件中的确切位置
  • @ankit 整个 div
  • 我们可以访问您的网站还是在本地?

标签: javascript php wordpress .htaccess malware


【解决方案1】:

试试这个

$(document).ready(function(){
    setTimeout(function(){
       $('a[href*="http://themestotal.com"]').closest('div').remove();
    },2000);
});
<!--html part-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<p>Lorem ipsum dolor sit amet</p>
<div>
<h3><strong><a style="font-size: 11.335pt;" href="http://2giadinh.com/thoi-trang">thời trang 
trẻ em</a></strong>
<strong><a style="font-size: 11.335pt;" href="http://themestotal.com">Wordpress Themes
 Total Free</a></strong>
<em><a style="font-size: 10.335pt;" href="http://2xaynha.com">tư vấn xây nhà</a></em>
<em><a style="font-size: 10.335pt;" href="http://lanakid.com">thời trang trẻ em</a></em>
<em><a style="font-size: 10.335pt;" href="http://2giaynu.com">shop giày nữ</a></em>
<em><a href="http://magentowordpresstutorial.com/wordpress-tutorial/wordpress-plugins">download
 wordpress plugins</a></em>
<em><a href="http://2xaynha.com/tag/mau-biet-thu-dep">mẫu biệt thự đẹp</a></em>
<em><a href="http://epichouse.org">epichouse</a></em>
<em><a href="http://fsfamily.vn/tag/ao-so-mi-nu">áo sơ mi nữ</a></em>
<em><a href="http://en.2xaynha.com/">House Design Blog - Interior Design and 
Architecture Inspiration</a></em></h3>
</div>
</div>

【讨论】:

  • 无法在网站上工作
  • 没有错误,我检查了
猜你喜欢
  • 2016-07-05
  • 2017-09-17
  • 2011-11-15
  • 2020-02-19
  • 1970-01-01
  • 2017-08-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多