最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Set site title & tagline with wp.config or function.php

programmeradmin5浏览0评论

Currently I can change Site Title & Tagline in Settings >> General but someone attack and remove it.

So now I want to set these via function.php or wp-config.php

Any Idea?

Currently I can change Site Title & Tagline in Settings >> General but someone attack and remove it.

So now I want to set these via function.php or wp-config.php

Any Idea?

Share Improve this question asked Jul 18, 2020 at 13:34 FRQ6692FRQ6692 1493 gold badges8 silver badges23 bronze badges 1
  • 2 If you've been hacked, this isn't going to help you. If the attacker is able to edit these settings, they are very likely to be able to edit your theme files. You have much bigger issues that need to be solved than trying to make these uneditable. Please review wordpress/support/article/faq-my-site-was-hacked – Jacob Peattie Commented Jul 18, 2020 at 16:10
Add a comment  | 

1 Answer 1

Reset to default 1

These fields have the keys 'blogname' and 'blogdescription' respectively in the options table.

I'm not sure exactly why you need to do this as it seems like a priority to secure your site and be able to update it through the dashboard yourself, but you can update them easily from functions.php with update_option, e.g.:

update_option( 'blogname', "site title goes here" );

update_option( 'blogdescription', "site tagline does here" );
发布评论

评论列表(0)

  1. 暂无评论