{"id":85093,"date":"2018-08-30T03:57:50","date_gmt":"2018-08-30T07:57:50","guid":{"rendered":"https:\/\/www.templatemonster.com\/help\/?p=85093"},"modified":"2020-02-06T06:18:25","modified_gmt":"2020-02-06T11:18:25","slug":"most-wanted-wordpress-tips-tricks-and-hacks","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/most-wanted-wordpress-tips-tricks-and-hacks.html","title":{"rendered":"Most Wanted WordPress Tips, Tricks, and Hacks"},"content":{"rendered":"<p>WordPress is the most popular CMS platform. We are going to show you the most popular tips, tricks, and hacks for WordPress websites. These tricks are going to make your live easier.<\/p>\r\n<h3 class=\"custom\">How to use a Custom Homepage<\/h3>\r\n<p>By default, WordPress displays blog posts on the Home page. It&#8217;s recommended to use custom page for website front-end.<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>To do that navigate to <strong>Pages<\/strong> > <strong>All Pages<\/strong> section in your back-end.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Enter your page title and specify its content. Once a page is ready, click on the <strong>Publish<\/strong> button.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>You will need to set up this page as a Home page now. Open <strong>Settings<\/strong> > <strong>Reading<\/strong> page in your admin panel.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t<p>Enable <strong>A static page (select below)<\/strong> option from the <strong>Your homepage displays<\/strong> section and select page you added from the <strong>Homepage<\/strong> dropdown.<\/p>\r\n\t\r\n\t<\/li>\r\n<\/ol>\r\n<h3 class=\"custom\">Deactivate All Plugins when not able to access WP-admin<\/h3>\r\n<p>Do you know the situation when your site is down? The first thing you need to do is plugin deactivation. Your admin panel is locked and you don&#8217;t know what to do. Just follow the further steps:<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>Connect to your server using FTP or hosting cPanel. Open <strong>wp-content\/plugins<\/strong> directory.<\/p>\r\n\t<\/li>\r\n\t<li><p>Now just rename plugins folder to <em>plugins_backup<\/em>. All plugins will be deactivated right away. You can try to access your website now.<\/p>\r\n\t<\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Install Google Analytics in WordPress<\/h3>\r\n<p>Google Analytics allows you to gather information about the most popular posts on your website, get info about site visitors. To get this info you need to do 2 simple steps:<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>Getting Google Analytics code.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Inserting this code to WordPress website.<\/p>\r\n\t<\/li>\r\n<\/ol>\r\n<p>We recommend that you check our video tutorial on how to <a href=\"\/help\/how-to-install-google-analytics-on-wordpress.html\" target=\"_blank\">install Google Analytics on WordPress<\/a> to get more details.<\/p>\r\n\r\n<h3 class=\"custom\">Password Protect WordPress Admin Directory<\/h3>\r\n<p>WordPress has a backend where all the changes are performed. That page is password protected by default. Users enter their login details when trying to access the admin panel. But there is one more way to protect your website backend. You can enable wp-admin directory password protection.<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>Login into your hosting cPanel and locate <strong>Password Protect Directories<\/strong> icon under the security section.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>You will see popup asking you to select password protected directory. Choose <strong>\/wp-admin\/<\/strong> directory and specify your username and password.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Try to access your admin panel page now. You should see an authorization box now.<\/p>\r\n\t<\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Limit login attempts<\/h3>\r\n<p>You can enter your login details to WordPress unlimited times. It allows to guess your password. To protect your site from hackers we recommend that you limit login attempts for your website.<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>You can use <strong><a href=\"https:\/\/wordpress.org\/plugins\/login-lockdown\/\" target=\"_blank\" rel=\"nofollow\"> Login LockDown<\/a><\/strong> plugin to do that.<\/p>\r\n\t\t<ul class=\"list\">\r\n\t\t\t<li>\r\n\t\t\t\t<p>Navigate to <strong>Plugins<\/strong> > <strong>Add New<\/strong> page in your back-end. Enter &#8216;Login LockDown&#8217; to the search field<\/p>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<p>Install and activate the plugin.<\/p>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Open <strong>Settings<\/strong> > <strong>Login LockDown<\/strong> page in your admin panel.<\/p>\r\n\t<\/li>\r\n\t<li><p>Change core plugin settings:<\/p>\r\n\r\n\t\t<ul class=\"list\">\r\n\t\t\t<li>\r\n\t\t\t\t<p>You can change max login retries here. Number of failed login attempts within the <strong>&#8220;Retry Time Period Restriction&#8221;<\/strong> needed to trigger a LockDown.<\/p>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<p>Set up retry time period restriction (minutes). Amount of time that determines the rate at which failed login attempts are allowed before a LockDown occurs.<\/p>\r\n\t\t\t<\/li>\r\n\t\t\t<li>\r\n\t\t\t\t<p>You can decide on how long a particular IP block will be locked out for once a LockDown has been triggered. You can do that under the <strong>Lockout Length (minutes)<\/strong>.<\/p>\r\n\t\t\t<\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Remove WordPress Version Number<\/h3>\r\n<p>You can see your WordPress version in the bottom right corner. It&#8217;s better to remove WordPress version notification for security reasons.<\/p>\r\n<p>You can use following PHP code to do that:<\/p>\r\n<pre class=\"brush:php\">function my_remove_version() {\r\n\treturn '';\r\n\t}\r\n\tadd_filter('the_generator', 'my_remove_version');<\/pre>\r\n<p>Just add those lines to your <strong>functions.php file<\/strong> and check the result.<\/p>\r\n\r\n<h3 class=\"custom\">Adding custom CSS to a WordPress Theme<\/h3>\r\n<p>You are going to add custom CSS to customize the appearance and layout of your site. Custom CSS code allows you to adjust colors, font size, paddings, etc.<\/p>\r\n<p>The best way to add additional CSS is to use an inbuilt customizer. You can do that under <strong>Appearance<\/strong> > <strong>Customize<\/strong> section in your backed.<\/p>\r\n\r\n<p>Locate <strong>Additional CSS<\/strong> tab on the next screen and add the CSS code to the field you will see. Don&#8217;t forget to publish your changes.<\/p>\r\n\r\n<h3 class=\"custom\">Use Shortcodes inside Text Widgets<\/h3>\r\n<p>Text widgets don&#8217;t allow you to add shortcodes. They can be used for plain text or HTML code only.<\/p>\r\n<p>To enable shortocodes for the widgets section you need to perform a few simple steps:<\/p>\r\n<ol>\r\n\t<li><p>Open <strong>Appearance<\/strong> > <strong>Editor<\/strong> page in your backend.<\/p><\/li>\r\n\t<li><p>Locate <strong>functions.php<\/strong> file there.<\/p><\/li>\r\n\t<li><p>Add following function to that file:<\/p>\r\n\t\t<pre class=\"brush:php\">add_filter('widget_text', 'do_shortcode');<\/pre>\r\n\t<\/li>\r\n\t<li><p>Save file by clicking <strong>Update file button<\/strong>. That is it! Feel free to add shortcode to text widgets now. You can manage widgets under the <strong>Appearance<\/strong> > <strong>Widgets<\/strong> page in your backend.<\/p><\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Open Navigation Menu Link in New Window<\/h3>\r\n<p>Do you want to add a custom link to your website menu? But at the same time, you don&#8217;t want your site visitors to be redirected out from your website? You can make this custom link open in a new window.<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>Open <strong>Appearance<\/strong> > <strong>Menus<\/strong> page in your backend.<\/p>\r\n\t<\/li>\r\n\t<li><p>Expand menu item that has to be opened in a new window and check if <strong>Open link in a new window<\/strong> option is available. The most likely you will not see it. But don&#8217;t get upset. You can easily enable it:<\/p>\r\n\t\t<ul class=\"list\">\r\n\t\t\t<li><p>Click <strong>Screen Options<\/strong> tab in top right corner.<\/p><\/li>\r\n\t\t\t<li><p>Check <strong>Link Target<\/strong> option under the <strong>Show advanced menu properties<\/strong> section.<\/p><\/li>\r\n\t\t<\/ul>\r\n\t<\/li>\r\n\t<li><p>Now your can scroll down to your menu item. You will see <strong>Open link in a new window<\/strong> option available. Check it to make your menu item open in a new link and avoid site redirection.<\/p>\t\r\n\t\t\r\n\t<\/li>\r\n\t<li><p>Save menu and check your site to see the change.<\/p><\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Using Inspect Element Tool to Customize WordPress<\/h3>\r\n<p>&#8220;How do I know what CSS code to edit?&#8221; &#8211; That is the question we hear every day. We will provide you with a short guide on how to find our CSS code to edit.<\/p>\r\n<p>Almost all browsers have inspect element option. Let&#8217;s take a closer look at Chrome Inspector tool.<\/p>\r\n<ol>\r\n\t<li><p>Open your website and right click with your mouse on the element you want to modify.<\/p><\/li>\r\n\t<li><p>Select <strong>Inspect<\/strong> option from browser&#8217;s menu (or just use Ctrl+Shift+I hotkeys).<\/p><\/li>\r\n\t<li><p>You can see new box on your screen now. It contains your page HTML and CSS code. That is what we need.<\/p>\r\n\r\n\t<\/li>\r\n\t<li><p>From the CSS section you can get CSS code to edit.<\/p>\r\n\t\t<p>You can make the changes here. They will be immediately shown on your screen. But remember! changes will not be saved on your website. You need to add them to CSS files or Additional CSS field (refer to Adding custom CSS to a WordPress Theme section in this tutorial).<\/p>\r\n\t<\/li>\r\n<\/ol>\r\n<p>We recommend that you check our video tutorial on <a href=\"\/help\/use-google-chrome-web-inspector.html\" target=\"_blank\"> how to use Google Chrome Web Inspector<\/a> for more details.<\/p>\r\n\r\n<h3 class=\"custom\">Allow user registration on your WordPress Site<\/h3>\r\n<p>WordPress is very flexible platform. It allows you to add users with different roles. Also, you can enable user registration. So your site visitors will register on your website themselves. A few simple steps have to be done:<\/p>\r\n<ol>\r\n\t<li><p>Login into your WordPress backend and open <strong>Settings<\/strong> > <strong>General<\/strong> page from WordPress menu.<\/p><\/li>\r\n\t<li><p>Locate <strong>Membership<\/strong> section and enable <strong>Anyone can register<\/strong> option.<\/p>\r\n\t\r\n\t<\/li>\r\n<\/ol>\r\n<p>For more details check <a href=\"\/help\/how-to-allow-user-registration-on-your-wordpress-site.html\" target=\"_blank\">how to allow user registration on your WordPress site<\/a> tutorial.<\/p>\r\n\r\n<h3 class=\"custom\">Add Custom Default Gravatar Image<\/h3>\r\n<p>All the comments on WordPress websites have default gravatar image called &#8216;Mystery Person&#8217;. To have some unique image for your blog comments you can upload custom gravatar images.<\/p>\r\n<p>First of all you need to upload your picture to the website. It can be done under the <strong>Media Library<\/strong> section in your backend.<\/p>\r\n<p>Don&#8217;t forget to copy image URL after upload.<\/p>\r\n\r\n<p>Now you can proceed to the next step, gravatar implementation. Open your theme <strong>functions.php<\/strong> file (it can be found under <strong>Appearance<\/strong> > <strong>Editor<\/strong> page in your back-end) and paste following function:<\/p>\r\n<pre class=\"brush:php\">add_filter( 'avatar_defaults', 'wpb_new_gravatar' );\r\n\tfunction wpb_new_gravatar ($avatar_defaults) {\r\n\t$myavatar = 'http:\/\/example.com\/wp-content\/uploads\/2017\/01\/wpb-default-gravatar.png';\r\n\t$avatar_defaults[$myavatar] = \"Default Gravatar\";\r\n\treturn $avatar_defaults;\r\n\t}<\/pre>\r\n<p>Replace <strong>$myavatar<\/strong> value with custom image URL you added earlier.<\/p>\r\n<p>Visit <strong>Settings<\/strong> > <strong>Discussions<\/strong> page to see your new gravatar image added there.<\/p>\r\n\r\n<h3 class=\"custom\">Add Images in WordPress Sidebar<\/h3>\r\n<p>That is not an easy task to add image to WordPress sidebar. There is no simple upload image featured available by default. But there is one simple way to add insert image to the sidebar.<\/p>\r\n<ol>\r\n\t<li>\r\n\t\t<p>First of all you need to upload image to your website. It could be done under the <strong>Media Library<\/strong> > <strong>Add New<\/strong> section in your back-end. Don&#8217;t forget to copy image URL after upload.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t<p>Next, go to <strong>Appearance<\/strong> > <strong>Widgets<\/strong> page. Select <strong>Text<\/strong> widget from the widgets available and drop it to the <strong>Sidebar<\/strong> position.<\/p><\/li>\r\n\t<li>\r\n\t\t<p>Inside this widget you will need to insert HTML code:<\/p>\r\n\t\t<pre class=\"brush:html\">&lt;img src=&quot;Paste image URL here&quot; alt=&quot;Alternate text&quot; \/&gt;<\/pre>\r\n\t\t<p>Where <em>Paste image URL here<\/em> is your image URL and <em>Alternate text<\/em> is your alternative text.<\/p>\t\r\n\t\t\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Save widget by clicking <strong>Save<\/strong> button. Ready! Image is added to sidebar now.<\/p>\r\n\t<\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Automatically Close Comments on Old Articles<\/h3>\r\n<p>To protect your posts from getting regular spam content you can disable comments on the old articles. This option is available in WordPress by default. So you can easily turn it off from the <strong>Settings<\/strong> > <strong>Discuss<\/strong> page in your backend.<\/p>\r\n\r\n\r\n<h3 class=\"custom\">Add multiple authors to a WordPress post<\/h3>\r\n<p>WordPress posts are assigned to one author by default. But you can assign it to several authors. The best option is additional Co-Authors Plus plugin installation.<\/p>\r\n<p>Install plugin following our video tutorial on <a href=\"\/help\/how-to-install-a-wordpress-plugin-for-beginners.html\" target=\"_blank\">how to install a WordPress plugin for beginners<\/a> and configure it:<\/p>\r\n<ol>\r\n\t<li><p>Now edit post or page where you need to have multiple authors.<\/p><\/li>\r\n\t<li><p>Locate <strong>Authors<\/strong> section on the post page.<\/p>\r\n\r\n\t<\/li>\r\n\t<li><p>Click on an author to change them. Also you can drag to change their order, click on <strong>Remove<\/strong> to remove them.<\/p><\/li>\r\n<\/ol>\r\n\r\n<h3 class=\"custom\">Add Category Icons in WordPress<\/h3>\r\n<p><a href=\"https:\/\/wordpress.org\/plugins\/taxonomy-images\/\" target=\"_blank\" rel=\"nofollow\">Taxonomy Images plugin<\/a> is a good decision to add category images in WordPress. Install and activate this plugin under the same <strong>Plugins<\/strong> > <strong>Add New<\/strong> section in your admin panel.<\/p>\r\n<p>Make sure plugin is enabled for post&#8217;s categories. Open <strong>Settings<\/strong> > <strong>Taxomony Images<\/strong> page. Check <strong>Categories<\/strong> option and save the changes.<\/p>\r\n\r\n<p>Visit <strong>Posts<\/strong> > <strong>Categories<\/strong> page in your WordPress admin panel and click on the add button next to the question mark image. Check your site to see the category image.<\/p>\r\n\r\n<h3 class=\"custom\">How to Display Relative Dates in WordPress<\/h3>\r\n<p>Relative date can give your website visitors understanding of how much time has passed since post is published. To add such setting to your site you need to install and activate <a href=\"https:\/\/wordpress.org\/plugins\/meks-time-ago\/\" target=\"_blank\" rel=\"nofollow\">Meks Time Ago<\/a> plugin.<\/p>\r\n<p>After activation find <strong>Meks Time Ago<\/strong> section on <strong>Settings<\/strong> > <strong>General<\/strong> page on your website.<\/p>\r\n\r\n<p>You can apply &#8220;time ago&#8221; format and change other settings here.<\/p>\r\n\r\n<h3 class=\"custom\">Update WordPress URLs when Not Able to Access WP-Admin<\/h3>\r\n<p>Do you know the situation when you cannot access site when moving WordPress site to a new domain? Site frontend and backend are not available. Don&#8217;t panic! You can update your website URL in <strong>functions.php file.<\/strong><\/p>\r\n<p>Connect to your server from FTP or hosting cPanel. Open <strong>wp-content\/themes\/your_theme_name<\/strong> folder. Edit and find functions.php file. Add following code to that file:<\/p>\r\n<pre class=\"brush:php\">update_option( 'siteurl', 'http:\/\/example.com' );\r\nupdate_option( 'home', 'http:\/\/example.com' );<\/pre>\r\n<p>Where <em>http:\/\/example.com<\/em> is correct website URL.<\/p>\r\n<p>Don&#8217;t forget to update URL in your WordPress backend. Open <strong>Settings<\/strong> > <strong>General<\/strong> page and update <strong>WordPress Address<\/strong> and <strong>Site Address URLs<\/strong> there.<\/p>\r\n\r\n\r\n<h3 class=\"custom\">Changing the Author of a WordPress Post<\/h3>\r\n<p>Decided to change author of the post?<\/p>\r\n<p>You will need to edit the post where you want to change the author. <strong>Authors<\/strong> option is disabled by default. But you can enable it from the <strong>Screen Options<\/strong> at the top right corner of the screen.<\/p>\r\n<p>Now you have Authors box on your post page. Feel free to click on an author to change them.<\/p>","protected":false},"excerpt":{"rendered":"<p>WordPress is the most popular CMS platform. We are going to show you the most popular tips, tricks, and hacks for WordPress websites. These tricks are going to make your live easier.<\/p>\n","protected":false},"author":55,"featured_media":85110,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2017,728],"tags":[2679,2677,2678],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/85093"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=85093"}],"version-history":[{"count":19,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/85093\/revisions"}],"predecessor-version":[{"id":86296,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/85093\/revisions\/86296"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/85110"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=85093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=85093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=85093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}