How to optimize and secure your Wordpress site without plugins (2024)

How to optimize and secure your Wordpress site without plugins (1)

Topic: Search Engine Optimization (SEO), optimization, wordpress

How to optimize and secure your Wordpress site without plugins (2)

We've built a number of websitesover the years. From websites for nonprofits, to over 250 professional athlete sites, and everything in between, and if there's one thing we have learned, it's how important website speed, security and performance are.

Website performance has a profound effect on how your website ranks in search results for better SEO, as well as how your visitors engage with your site and your brand. Slower page load times lead to increases in abandonment - according to Kissmetrics,40% of people abandon a website that takes more than 3 seconds to load, and47% of consumers expect a web page to load in 2 seconds or less.

Yes, there are a seemingly endless number of plugins that you can download or install with a quick click of a few buttons, but will they really give you the speed boost and security you need? Maybe, but what if I told you that some times they can actually cause more damage than good. Don't believe me - just check out this articlefrom Smashing Magazine that gives some specifics on Wordpress performance improvements that can go wrong.

Don't worry though, we are going to cover how to get the most out of your wordpress website without having to edit a ton of files, or download a bunch of plugins. You won't need to worry about compatibility or updating issues, or any of the other problems that might arise. A quick word of caution, make sure to make a backup of your site and database before making ANY changes, including the one's outlined below.

NOTE: This article assumes you have access to your webserver, and is written more specifically for those running Apache.

To boost performance and speed of your wordpress website:

  1. Start by moving javascript into the footer (footer.php) to enhance page load times.
    1. You can do this in your functions file, if you're calling your javascript files correctly with wp_register_script and wp_enqueue_script (learn more)
    2. Or if you're calling them from an external source, just move the whole
      <script type="text/javascript" src="/scripts/emailpage.js"></script>
  2. Remove the unnecessarycalls to your database or options files:
    1. Edit your theme files and look for things like: "<?php get_bloginfo(‘wpurl’); ?>" and replace them with the actual URL. Hint: You'll usually find these in the header.php and footer.php file.
    2. Code the URLs right into your wp-config file so your site doesn't need to go looking for them in the database each time. You can do this by opening wp-config.php in a text editor and adding the following lines above "/* That's all, stop editing! Happy blogging. */"
      define('WP_HOME', 'https://www.nonstopwellness.com');
      define('WP_SITEURL', 'https://www.nonstopwellness.com');
  3. Limit the number oftimes you write to your database and number of versions of posts by adding the following to your wp-config.php file, right below the lines you added in the example above:
    1. define('AUTOSAVE_INTERVAL', 120); // the 120 is the number of seconds to wait to autosave
    2. define('WP_POST_REVISIONS', 5); // the 5 is the number of posts to save
    3. define('EMPTY_TRASH_DAYS', 7 ); // the 7 is the number of days something remains in the trash
  4. Enable mod_deflate in .htaccess - place the following at the top
    1.  <IfModule mod_deflate.c>AddOutputFilterByType DEFLATE text/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE text/cssAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/xhtml+xmlAddOutputFilterByType DEFLATE application/rss+xmlAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE application/x-javascript</IfModule>
  5. Set expires headers in .htaccess- place the following at the top, below the lines above
    1.  # BEGIN Expire headers
      <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 5 seconds"
      ExpiresByType image/x-icon "access plus 2500000 seconds"
      ExpiresByType image/jpeg "access plus 2500000 seconds"
      ExpiresByType image/png "access plus 2500000 seconds"
      ExpiresByType image/gif "access plus 2500000 seconds"
      ExpiresByType application/x-shockwave-flash "access plus 2500000 seconds"
      ExpiresByType text/css "access plus 600000 seconds"
      ExpiresByType text/javascript "access plus 200000 seconds"
      ExpiresByType application/javascript "access plus 200000 seconds"
      ExpiresByType application/x-javascript "access plus 200000 seconds"
      ExpiresByType text/html "access plus 600 seconds"
      ExpiresByType application/xhtml+xml "access plus 600 seconds"
      </IfModule>
      # END Expire headers
  6. Add cache control headers to.htaccess- place the following below the lines above
    1.  # BEGIN Cache-Control Headers
      <IfModule mod_headers.c>
      <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
      Header set Cache-Control "public"
      </filesMatch>
      <filesMatch "\.(css)$">
      Header set Cache-Control "public"
      </filesMatch>
      <filesMatch "\.(js)$">
      Header set Cache-Control "private"
      </filesMatch>
      <filesMatch "\.(x?html?|php)$">
      Header set Cache-Control "private, must-revalidate"
      </filesMatch>
      </IfModule>
      # END Cache-Control Headers

Toadd an extra layer of security for your wordpress website, try the following:

  1. Delete the first user you create when you're setting up your account. Oftentimes people create a generic admin user, and that user is given the user number "1". Pretty easy for a hacker to guess the user name and the user number, then it's just a matter of time and effort to get your password. From the wordpress admin, create a new user with admin priviledges, log out, and log in as the newly created user. Then delete the default/admin user.
  2. It probably goes without saying, but use a strong password. This should be something easy for you to remember but hard for someone to guess, and mix it up a little from site to site - don't always use the same password. Pro Tip: Try using a phrase with some uppercase and lowercase letters and numbers and characters i.e. "ThisIsThePhraseICreatedIn2016".
  3. Change the default database table prefix, which is usually "wp_". You're going to need database access to do this and you can get the full explanation on how to do this safely, here.
  4. Turn off file editing through the wordpress admin - this is usually the first thing hackers will try to access if they get into your site. You can make this update by adding the following to wp-config.php above where you see "/* That's all, stop editing! Happy blogging. */"
    1. define('DISALLOW_FILE_EDIT', true);
  5. Frequently update your wordpress salts. These live in your wp-config.php file and they can be created here -https://api.wordpress.org/secret-key/1.1/salt/
  6. Disable the wordpress version which hackers can use to exploit your installation - add the following to functions.php or your custom plugin file
    1. /**
      * Remove the WordPress version
      */
      add_filter('the_generator', '__return_false');
  7. Disallow HTML in wordpress comments within the same file as above
    1. /**
      * Disable HTML in WordPress comments
      */

      add_filter( 'pre_comment_content', 'esc_html' );

  8. Disable login hints in wordpress, again in your functions.php file:
    1. /**
      * Disable WordPress Login Hints
      */
      function no_wordpress_errors(){
      return 'Please try the right user/pass combination';
      }
      add_filter( 'login_errors', 'no_wordpress_errors' );
  9. Always bediligent and keep your wordpress and plugins up-to-date and backed up.

This list, of course, is not exhaustive, but it's a pretty quick and easy way to combat a number of the common issues that may arise when you're creating or maintaing wordpress whether for you or a client. Your hosting provider can often offer host specific information on performance and security enhancements, but we are ALWAYS here to assist and offer expertise. Just contact usand we will be in touch to get you on the right path.

How to optimize and secure your Wordpress site without plugins (3)

Written by Kyle Barkins

Kyle Barkins co-founded Tapp Network with more than 10 years in marketing and application development, and calls on his experience to enhance the usability of web and mobile applications for high-conversions for our clients.

How to optimize and secure your Wordpress site without plugins (2024)

FAQs

How to optimize and secure your Wordpress site without plugins? ›

The primary reason your WordPress website might be displaying a “Not Secure” warning is due to the lack of a valid SSL (Secure Sockets Layer) certificate. If you do have an SSL certificate but are still seeing the warning, it's possible that your certificate has expired.

How can I optimize my WordPress site speed without plugins? ›

Website Speed Optimization Without Plugins
  1. Image Optimization. ...
  2. Browser Caching. ...
  3. Minification of CSS, JavaScript, and HTML. ...
  4. Content Delivery Network (CDN) ...
  5. Gzip Compression. ...
  6. Optimize WordPress Database. ...
  7. Server Optimization. ...
  8. Lazy Loading for Images.
Dec 5, 2023

How do I make sure my WordPress site is secure? ›

How to Secure Your WordPress Site
  1. Secure your login procedures.
  2. Use secure WordPress hosting.
  3. Update your version of WordPress.
  4. Update to the latest version of PHP.
  5. Install one or more security plugins.
  6. Use a secure WordPress theme.
  7. Enable SSL/HTTPS.
  8. Install a firewall.
Mar 4, 2024

How do I make with my WordPress website more safer? ›

WordPress security guide: 11 steps to secure your site from hackers
  1. Choose a secure host. ...
  2. Keep WordPress core, themes, and plugins up to date. ...
  3. Create secure WordPress usernames and passwords. ...
  4. Set up off‑site backups. ...
  5. Add brute force attack protection. ...
  6. Scan for malware and security issues. ...
  7. Implement downtime monitoring.
Mar 22, 2024

How to use WordPress without plugin? ›

Step-by-Step Guide to Creating a Form in WordPress Without a Plugin
  1. Step 1: Create a Page for the Form. ...
  2. Step 2: Adding Form Fields using HTML. ...
  3. Step 3: Styling the Form with CSS. ...
  4. Step 4: Processing Form Submissions with PHP. ...
  5. Step 5: Testing the Form.
Sep 30, 2023

How do I manually optimize my WordPress site? ›

How to speed up your WordPress website
  1. Choose a great hosting provider and a good hosting plan. ...
  2. Update your PHP to a newer version. ...
  3. Update your WordPress version is an easy fix. ...
  4. Implement a caching solution. ...
  5. Use a lightweight theme. ...
  6. Deactivate and remove unused plugins. ...
  7. Optimize your images: a quick fix to speed up your pages.
Feb 1, 2023

What can you do to optimize your WordPress website? ›

Accelerate WordPress load times by 70% with Cloudflare!
  1. Look for Inactive Plugins or Plugins that Don't Work Properly. ...
  2. Compress Media Files. ...
  3. Compress Your WordPress Site's Size. ...
  4. Check if the Website and the Database Are in the Same Data Center. ...
  5. Optimize Your WordPress Site's Homepage. ...
  6. Update Update Update. ...
  7. Disable Hotlinking.
Oct 24, 2023

Why is my WordPress site not fully secure? ›

The primary reason your WordPress website might be displaying a “Not Secure” warning is due to the lack of a valid SSL (Secure Sockets Layer) certificate. If you do have an SSL certificate but are still seeing the warning, it's possible that your certificate has expired.

How do I fix insecure content in WordPress? ›

Resolving Mixed Content Errors
  1. Verify there is a valid SSL installed by clicking on the padlock icon. ...
  2. Configure the page to force HTTPS requests: ...
  3. Change your site's URL in the Settings > General page of your WordPress Admin Dashboard from HTTP to HTTPS.
  4. Purge WP Engine server caches.
  5. Purge browser cache OR,
Mar 8, 2024

What is the most important part of keeping a WordPress site secure? ›

It is important to maintain a strong password. Having a weak password will allow a hacker to gain access to your website easily. A strong password should include capital letters, lowercase letters, a number and/or a symbol of some type. DO NOT use the same password for every instance that you need one.

What is the most vulnerable part of a WordPress website? ›

The 20 most common WordPress security issues and vulnerabilities
  1. Lack of WordPress security plugins. ...
  2. Lack of regular site scans. ...
  3. Lack of regular site backups. ...
  4. Outdated WordPress versions or plugins. ...
  5. Outdated PHP version. ...
  6. A hosting environment that's not secure. ...
  7. Weak password and login credentials. ...
  8. Lack of 2FA.
Dec 11, 2023

Why does WordPress get hacked so much? ›

Because WordPress is so widely used, it's an incredibly popular target for hackers. Even though the WordPress core is usually very secure, WordPress is also a modular platform—it can be extended in any number of ways with themes and plugins.

Are WordPress plugins necessary? ›

The WordPress Plugin Directory offers a variety of tools to add features to your site. You don't need to use plugins to create a website with WordPress, but it's likely you'll want features and functionality that the platform doesn't provide by default. There are a lot of reasons to add plugins to your WordPress site.

How to cache WordPress without plugin? ›

Leverage Browser Caching via htaccess (without plugin)
  1. Go to WordPress Dashboard/cPanel of your website.
  2. Open . htaccess file (or config file).
  3. Paste the code given below in . htaccess file of the WordPress site.
  4. Save changes and you're done.
  5. Test your site with PageSpeed tools again to see the changes.
Sep 1, 2019

How do I export a WordPress site without plugins? ›

If you have some technical knowledge, you can manually migrate WordPress without any third-party tools.
  1. Step 1: Export Your Database.
  2. Step 2: Transfer Your Site Files to the New Server.
  3. Step 3: Create a New Database.
  4. Step 4: Import Your Original Database.
  5. Step 5: Edit the wp-config.php File.
  6. Step 6: Update Your DNS Settings.

How do I increase page speed in WordPress? ›

9 Advanced WordPress Performance Optimization Strategies
  1. Load JavaScript deferred and delay Javascript execution.
  2. Defer non-critical CSS, remove unused CSS, and inline critical CSS.
  3. Minify Javascript.
  4. Minify CSS.
  5. Optimize your WordPress database and reduce database calls.
  6. Split long posts into pages.
  7. Disable hotlinking.
Jan 25, 2024

Do WordPress plugins affect website speed? ›

However, adding too many plugins to your WordPress website can become problematic. In most cases, too many plugins slow down your website and hamper load-times. If you're using a free app maker like AppMySite, a loss in website speed can decelerate your app too.

Do more plugins slow down WordPress? ›

Yes, plugins can potentially slow down your WordPress site. The impact on performance depends on several factors, including the quality of the plugins, how well they are coded, and how many plugins you have installed.

How to reduce initial server response time in WordPress without plugin? ›

5 Ways to Reduce Initial Server Response Time
  1. Reduce Page Bloat. Heavy and poorly-coded themes, plugins, and content can harm your loading times. ...
  2. Use a Content Delivery Network (CDN) A CDN is a group of servers located globally. ...
  3. Optimize Your Database. ...
  4. Configure Caching. ...
  5. Choose a Fast and Reliable Web Host.
Jan 5, 2024

Top Articles
Latest Posts
Article information

Author: Roderick King

Last Updated:

Views: 6038

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Roderick King

Birthday: 1997-10-09

Address: 3782 Madge Knoll, East Dudley, MA 63913

Phone: +2521695290067

Job: Customer Sales Coordinator

Hobby: Gunsmithing, Embroidery, Parkour, Kitesurfing, Rock climbing, Sand art, Beekeeping

Introduction: My name is Roderick King, I am a cute, splendid, excited, perfect, gentle, funny, vivacious person who loves writing and wants to share my knowledge and understanding with you.