5. WordPress topic creation tips [Delete useless topic information led by add_action and remove_action]

Source: Internet
Author: User
Tags wordpress version

Useless topic information dominated by add_action and remove_action is deleted.

In most WordPress Themes, some platform information, developer information, cache files, and so on are inevitable. In this case, some things are rarely used, and some things are used for publicity by platforms or developers. These things can be deleted from the simplicity of theme appearance and theme use experience. Below are several points:

First.Do not allow the URLs in comments to be automatically converted into hyperlinks. For now, the biggest function of this automatic conversion function is to facilitate SPAM comments, and will be converted regardless of the prefix, delete the file. Open the functions. php file in the topic folder (this file is called Sub base camp) and add it to it (Be careful not to insert it into other functions ).CodeOkay.

 
Remove_filter ('comment _ text', 'Make _ clickable', 9 );

Second.When using WordPress, you will often receive the update prompts and statistics of the plug-in. If you do not want to upgrade, these prompts will not disappear, so removing plug-in upgrades and statistics is also a pleasure. Open the functions. php file, add the following code to it, and then check the effect.

Add_action ('admin _ menu ', 'remove _ counts');FunctionRemove_counts (){Global $ Menu,$ Submenu;$ Menu[65] [0] = 'ins ins';$ Submenu['Index. php'] [10] [0] = 'updates';}

Third.We all know that there are often spam comments and deletedArticleThese can be deleted using the built-in functions of WordPress, but using code is another quick method. Run the query in the background.

1. Delete the articles in the recycle bin.

Delete FromWp_postsWherePost_status='Trash';

2. delete comments and comments that are filtered out as spam.

 
Delete FromWp_commentsWhereComment_approvedIn('Spam','Trash');

Fourth.The Wordpress version information is added to the system by default, which reminds you to upgrade the service. However, if you do not want to upgrade it for the moment, you can delete it. Still open functions. php and add the following code in it.

Remove_action ('wp _ head', 'wp _ generator ');

 

In addition to the above, you can also delete information that is not very useful based on your personal interests.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.