Learning how to add Google Analytics to WordPress is a very important part of running your own website. The software can give you invaluable information about what is and isn’t working on your site and lets you make informed decisions about its future.
In this tutorial, we’re going to answer the most important questions about Google Analytics, including:
- What is Google Analytics and Why Do You Need It?
- How to Sign Up With Google Analytics
- The Basics of Google Analytics
- How to Add Google Analytics to WordPress Without a Plugin
- How to Install Google Analytics with a WordPress Plugin
- Other Plugin Options
- Google Analytics and WordPress in a Nutshell
Let’s go!
Disclaimer: Google published a new version of Google Analytics, named Google Analytics 4, in October 2020. The update comes with an overhaul of its interface and changes to its tracking code. Since the new version is going to be the standard going forward, we will be using screenshots from inside Google Analytics 4 in this tutorial. However, so far, none of the WordPress plugins mentioned below support the new version of Analytics (not even Google’s own), so we will include instructions for how you can still access the older version as well.
What is Google Analytics and Why Do You Need It?
Before getting into the technical stuff, let’s first talk about the subject matter of this post: Google Analytics. If you’re a complete newbie, you might not even be aware of what it is and why it’s a good idea to connect it to your WordPress website. So, let’s cover that first.
1. Google Analytics Helps You Get to Know Your Audience
Google Analytics is a web analytics suite that helps you understand and analyze your web traffic. Over 50 million websites around the world use it.
The way it works is that you add a piece of JavaScript code to your page (more on that below), which allows Google to track the activities of visitors coming to your site. They will then collect these activities and present them in the form of statistics in your Google Analytics account.
Here’s what you can learn from this information:
- Who is visiting your site? — Geographical and technical information about where your audience is from and the devices they use to access your site. You can also segment your audience into subgroups so you have a better understanding of who you are trying to appeal to.
- What do your visitors do? — Find out which pages they look at, how long they stay on your site, how they navigate from page to page, and more.
- When are they coming by? — Google Analytics also shows you when exactly people come to your site by the hour, day, week, or month.
- How do they find your site? — You get information about whether your audience finds your site in search engines (and which of them), social media, links on other websites, or if they enter your site address directly.
- How do they interact with your content? — Google Analytics lets you understand how people interact with your WordPress site, for example, which links they click on. If you define certain goals (like converting visitors to email subscribers) you can also track that.
2. Use The Information To Optimize Your Website
What can you do with this data? Knowing the above allows you to do many things:
- Adjust your site to serve your audience better — For example, by improving technical aspects of your site or adding a language.
- Optimize traffic sources — Invest more in those that work particularly well or ramp up your efforts on those that don’t.
- Improve your content and content strategy — Give visitors more of what they are interested in and publish it at times they are most likely to be on your site.
- Track marketing campaigns — See if your efforts are working, same for product sales and other kinds of conversions.
- Find your worst-performing pages — This allows you to take steps to make them better.
In short, web analytics allow you to eliminate guesswork and let you make decisions about your site based on facts and hard data instead of a gut feeling or guesswork. In addition, Google Analytics is completely free to use, so it doesn’t contribute to website costs.
Google Analytics and GDPR
In recent years, the European Union has issued new privacy rules called the General Data Protection Regulation or GDPR for short. They are aimed to better protect consumer privacy and apply to anyone operating in Europe, doing business or advertising themselves there, collecting data about European users, or employing people in the EU.
So, basically almost everyone who has a website.
Since Google Analytics tracks a lot of data, it is naturally affected by the new laws. So, if you are going to use it on your WordPress site, you need to do it in a way that is compliant with the regulations. Thankfully, there are plenty of articles on the topic to help you do so.
How to Sign Up With Google Analytics
Are you convinced yet? Then let’s go over how to add Google Analytics to your site. First step: create a Google Analytics account.
1. Log in to Google
Before you can connect the web analytics to your site, you first have to sign up for them. You can do that by heading on over to the Google Analytics homepage, where you will first be asked to log into your Google account.

If you already have one, simply use it to log in. If not, click the button to sign up and create a whole new account. Once done with either, you will see the screen below. Hit the big blue button to get started.

2. Create an Analytics Account
In the first screen, you need to add a name for your Google Analytics account and determine the data sharing settings.

Note that your account can contain several websites for tracking. Consequently, an appropriate account name can be something like Business Websites.
You can disable all the data sharing options. You may want to keep the first one active if you are planning to use the enhanced demographics and interests report.
Hit Next when to proceed.

3. Set up a Property
In this step, you have to create a property. This is simply the website or app you want to track with Google Analytics. As already mentioned, you can have several of those under one account.
If you are planning to connect your WordPress site via a plugin, at this point in time, you need to create a property using the older version of Google Analytics (called “Universal Analytics”).
To do that, click on Show advanced options as shown in the screenshot above. This will open up a new panel where you can toggle to create a Universal Analytics property.

For future applications, it probably makes sense to create both properties for Google Analytics 4 as well as its earlier version, so you can leave that option enabled.
After that, you still need to enter a property name (for example, the name of your website) at the top and the site URL at the bottom. The time zone and currency should be self-explanatory.
Hit Next again.
4. Finish the Setup

In the final step, Google Analytics will ask you some more information about your website/business. This is optional and you can skip this section by clicking Create at the bottom. Or, input an industry category, the size of your business, and goals for using Google Analytics. The choice is yours.
Once you proceed, the page will display the terms of services and data processing terms, which you need to accept.

This will take you to your account, where the first step is to configure what email communication you want to receive from Google Analytics (it’s fine to leave it all empty and save).

5. Set Up a Data Stream
After that, it’s time to set up a data stream. This is the term Google Analytics uses for sources of data you want to track. It can either be an iOS or Android app or a web property. These are also the three choices Google Analytics will give you.
(Note that, if you set up both kinds of Google Analytics properties, this step will be done automatically and all you need to do is find your respective ID and tracking code.)

To add Google Analytics to a WordPress website, the natural choice here is Web. When you click it, you will be asked to define the website address and provide a name for the data stream. For the latter, something like Website Usage Data is an option.

Below that, you can configure what kind of data you want Google Analytics to collect. Click on + 3 more to see the additional options or the gear symbol on the right for a detailed description of each and the ability to switch them on and off.

Besides page views, Google Analytics 4 can capture when visitors scroll to the bottom of the screen, clicks on external links, what people search for in the internal site search, video usage, and file downloads.
Unless you have a good reason to change anything here, we recommend you just leave things as they are and click Create stream. You can still change these settings later anyway.
6. Find Your ID and Tracking Code
The following screen is where you find your tracking code and measurement ID.

We will add the tracking code to your WordPress site further below. To do so, you might either need the code or the measurement ID, so it makes sense to leave the browser tab open for the moment.
In case you close it and need to get there later, you can always find your tracking code under Admin > Data Streams and click on the name of your stream.
If you are using Universal Analytics, you find that same information under Admin > Property > Tracking Info > Tracking Code.

Only here you have a tracking ID instead of a measurement ID, which is also present in the code snippet. However, aside from that, everything about connecting Google Analytics to WordPress works the same.
The Basics of Google Analytics
Before we get to how to add the code to your site, let’s take the opportunity to have a quick look around the main Google Analytics interface (Analytics 4, that is). That way, you get a better understanding of the type of information you can find there. Click the Home button to get to the main page.

On the right, you will always see the statistics for your website, while on the left you can choose which data to look at. The part where you will spend your most time is Life Cycle. Here’s what kind of information you can find in the different sections:
- Realtime — Shows you what is going on on your site at the moment of observation. How many visitors are currently on it, where they are from, what they are looking at, and more.
- Acquisition — The number of users and new users that come to your site during a certain period of time and which sources send them to you.
- Engagement — How visitors interact with your site: Time they spent on it, how often they return, what pages they visit, and what they do on there.
- Monetization — If you sell products, offer in-app purchases, or run ads, this section can tell you about revenue, what products your visitors buy, ads they look at, and other financial information.
- Retention — Shows you the level of engagement, returns, and lifetime value of different user groups.
- Demographics — Who are the people in your audience? Where are they from? What’s their gender, interests, language, and other demographic information?
- Tech — Information about the technology visitors use to access your website such as type of device, operating system, browser, screen resolution, etc.
- Conversions — If you have set up goals or “conversion events” inside Google Analytics, here’s where you understand how well you are doing in achieving them. This part is very focused on apps though.
- Analysis — Offers ways to display your data in different graphs to help you make more sense of it.
All good so far? Then let’s get down to how to use Google Analytics on your WordPress site now.
How to Add Google Analytics to WordPress Without a Plugin
In order for Google Analytics to start tracking your visitors, the tracking code mentioned above needs to be present on every page of your site you want to track user behavior on. Usually, that’s all of them. Here’s how you can achieve that manually.
Option A: Insert the Code Into header.php
One of the main ways to add the tracking code to your site is to insert it into your header. This way, it will load on every page.
Thanks to the way WordPress is set up, this is very easy to achieve. Most standard themes have a header.php
file that is responsible for outputting the site header section. So, you can simply input the Google Analytics code here.
However, when you make changes to theme files, be aware that it’s always best to do it in a child theme. Otherwise, they will get lost when you update your main theme. Child themes are super useful in general and you should definitely read up about them. Also, don’t forget to back up your WordPress site when making any changes like this.
Once you have created your child theme, simply copy the header.php
from the main theme into it and start editing. You can do that directly in the WordPress back end via Appearance > Theme Editor.

Copy and paste the tracking code from Google Analytics into header.php
right after the opening <head>
tag.
Also, make sure the code is wrapped in <script>...</script>
brackets! Otherwise, browsers won’t recognize it for what it is. That’s it! Now save and you are good.
Be aware that your theme editor might be disabled for security reasons (which is a good idea). In that case, you can also make the edits on your server with an FTP client like FileZilla.
Alternatively, you can also use a plugin like Head, Footer and Post Injections to insert the script into your header. Some themes also have native functionality for doing so.
Option B: Use functions.php
Another possibility to add Google Analytics to WordPress without a plugin is to use the functions file. You can do the same thing as we did above, however, instead of adding the tracking code to header.php
directly, you insert it into the head section via a function.
To do so, simply edit your (child) theme’s functions.php
file and add the following piece of code (but use your own measurement or tracking ID instead of ours):
function ns_google_analytics() { ?>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B175YGY1T1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-B175YGY1T1');
</script>
<?php
}
add_action( 'wp_head', 'ns_google_analytics', 10 );
Save, upload, and from that moment, Google Analytics should start tracking what’s going on on your site.
Option C: Use a Custom Plugin
A third option to manually add the tracking code to your site is creating your own plugin (even if – technically – that’s not adding Google Analytics to WordPress without a plugin, but we really meant third-party plugins here). Using this method gives you the ability to switch tracking on and off from the WordPress back end. Plus, it makes sure that the Google Analytics code stays on your site even if you change themes.
If you have never created a plugin before, don’t worry – it’s really easy! Before we get to it just a quick note: for the below to work, your active theme needs to have the wp_head
hook inside header.php
. That’s usually implemented by default but it’s worth checking!
Once you’re done, all you need to do is create a new PHP file. Take the text editor of your choice, make a new file, and save it as something similar to nick-google-analytics.php
. Then, add the following code to it (hint: it’s the same function as before plus a header that lets WordPress know this is a plugin).
<?php
/*
Plugin Name: Custom Google Analytics Plugin
Plugin URI: http://websitesetup.org
Description: Add the Google Analytics tracking code to your site header.
Author: Nick Schäferhoff
Version: 1.0
*/
function ns_google_analytics() { ?>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B175YGY1T1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-B175YGY1T1');
</script>
<?php
}
add_action( 'wp_head', 'ns_google_analytics', 10 );
?>
Be sure to replace the sample tracking code (everything between <script/>
and </script>
) with your own. Also, adjust the plugin header to whatever you want.
Once done, save the file and upload it to your site’s plugin folder (wp-content > plugins). You can also give it its own subfolder if you like. When you are done, activate it from the WordPress back end like any other plugin.

While the above isn’t very complicated, an even easier way to install Google Analytics in WordPress is using one of the many available plugins. We will go over the process with one example now and later look at a few more options that can do the same.
How to Install Google Analytics with a WordPress Plugin
There are a whole bunch of plugins out there to add Google Analytics to WordPress. For this example, we will use Google Site Kit.
It’s an official Google plugin that makes connecting your site to Google Analytics very easy. Plus, it integrates with other Google services, namely Search Console, AdSense, and PageSpeed Insights.
The plugin is also free and displays the most important data right inside the WordPress dashboard. Plus, it has a solid 3.9-star rating with more than 700,000 installs. However, as mentioned in the introduction, it only works with Universal Analytics properties at this time.
Side note: As with every plugin you install on your site, it’s always advisable to consider functionality vs site speed. The more plugins you have, the more they usually impede page loading time. So, if you plan to use any of those listed below, consider running your site through a tool like Google Pagespeed Insights before and after you install it, to make sure it doesn’t drag down the performance too much.
With that out of the way, let’s go!
1. Install the Plugin
Naturally, whenever you want to use a plugin on your WordPress site, the first step is to install it. For that, simply go to Plugins > Add New. Search for it by name.

When you find it in the list, hit Install Now to start downloading it to your site. Activate when it’s done.
2. Start the Setup
When you first activate Google Site Kit, it will display a prompt at the top of the screen.

Here, you need to hit the Start Setup button. This will begin the process of verifying your site by taking you to this page:

Click Sign in with Google. In the next step, you have to log in to your Google account, or, if you are already logged in, pick the one you want to use.

Of course, it makes sense to choose the one that contains the Google Analytics account you created earlier. Once you make your choice, Google will ask for a bunch of permissions that you need to grant.
After that, the setup will ask you to verify site ownership, permit access to your Google account data, and add your site to Search Console. Basically, all you have to do is click yourself through the process, it’s very simple.
When done, you can return to your WordPress dashboard with the button that says so.

3. Connect to Google Analytics
Once the setup is finished, your site is connected to Google Search Console and will start collecting data in the back end.

However, this is a tutorial for how to add Google Analytics to your WordPress site, so, of course, we won’t stop there.
From the screenshot above, you can see that Site Kit adds its own menu item to the WordPress dashboard. Here, you will not only see your data later but it’s also where you manage the plugin settings.
Site Kit gives you several prompts to set up Google Analytics and other Google services but the official place to take care of this is under Site Kit > Settings > Connect More Services.

Here, under Analytics, click the blue link to set it up. The next step, again, takes you to a page where you need to choose which Google account to use, followed by prompts to grant access permissions.

After that, you go back to the WordPress back end to pick the account, property, and view you want to connect to. As mentioned, this does not work with Google Analytics 4 yet.

Pick whatever is appropriate and then click Configure Analytics. That’s it, your WordPress site is now connected to Google Analytics.
5. Check the Rest of the Plugins
When done with the initial operations, you can now view the information Google has on your site inside the WordPress dashboard. You find a mix of all of it under Site Kit > Dashboard.
However, the thing that interests us most at this point is the Google Analytics section, which you find under a menu item of the same name.

Here, you see the basic information about your site namely an audience overview (including a comparison to the previous period) as well as top content and acquisition channels.
In the upper right corner, you able to switch the time period that you see the data for (the last 7, 14, 28, or 90 days). You also have links everywhere that take you to the respective pages inside Google Analytics itself.
Under Site Kit > Settings > Connected Services, you can use the little arrow button to open your Google Analytics settings and then the Edit link to change its settings.

Here are some important options like the ability to anonymize visitor IP addresses (important for GDPR) and exclude logged-in users from being tracked. All of this is enabled by default, so you usually don’t have much to do here but it’s still worth checking.
Aside from that, the plugin doesn’t have that much more to offer. The admin settings pretty much only let you switch Google usage tracking on and off. You can also add more services, view their status under Connected Services, and also disconnect them there.
You are able to disconnect the entire Google Site Kit by clicking on the email address in the upper right corner and choosing Disconnect. That’s it, but it’s also this lean architecture that makes Site Kit such a good option to add Google Analytics to WordPress.
Other Plugin Options
As already mentioned, Site Kit is far from the only way to connect the web analytics suite to your site. Below are a few more options to choose from.
If these choices aren’t enough for you, there are even more. You can find them with a quick search in the plugin directory.
1. GA Google Analytics

This is the simplest solution for adding Google Analytics to WordPress. Just install, add your tracking ID, choose the tracking method, and whether to place the code in your header or footer, save, and you are done.
It has some more optional settings like adding custom markup, disabling tracking admin-level users, and using Google Analytics to track behavior in the WordPress back end.
However, this is as no-frills as it gets, which also explains the 4.9-star rating at more than half a million installs. For a similarly simple solution check Analytics Cat.
2. Google Analytics Dashboard Plugin for WordPress by MonsterInsights

This is the most popular WordPress plugin for Google Analytics integration. It easily adds the tracking code to your site via a setup wizard and also pulls data into the WordPress dashboard.
In addition, MonsterInsights integrates with popular eCommerce solutions and has the functionality to make the use of Google Analytics GDPR compliant. Plus, lots more features.
On the other hand, it is not quite as lightweight as other solutions but does its job well. There is also a premium version with even more functionality.
3. Google Tag Manager for WordPress

This plugin works with the official Google Tag Manager. This is a tag management system for analyzing traffic and optimizing your marketing and really meant for more than just setting up your analytics script.
The plugin pulls the tag manager container onto your WordPress site. That way, you can change what it contains in the central Google dashboard instead of on the site itself.
It’s a more complex solution but if it makes sense for your use case, go for it.
4. CAOS | Host Google Analytics Locally

This plugin is a little special because it allows you to host the Google Analytics script locally. Doing so is a good way to improve your site performance and it comes with other benefits.
The plugin also lets you anonymize visitor IP addresses, place the tracking code in the header or footer, and more. In addition, it integrates with other solutions such as MonsterInsights. For a premium alternative, check Perfmatters.
Google Analytics and WordPress in a Nutshell
Google Analytics is an important tool for improving your WordPress site. It can give you crucial information on your audience so you can serve them better.
In the post above, we talked about everything you need to know about this web analytics suite, including what to take into account in terms of data privacy laws.
Aside from that, as you have seen, adding the analytics to your site is not complicated. In essence, you just need to sign up and add the tracking code to your site.
The latter you can do manually either by adding it to template files, including it in a function, or a custom plugin. Plugins offer an even more convenient way and there are many different options for that, even if they currently only support the older version of the tracking tool.
By now, you are ready to add Google Analytics to your WordPress site. We hope it will help make your website even more successful!
Any thoughts on Google Analytics and WordPress? If so, please share it in the comments section below.
Sohrab Kasraeianfard
Thanks a lot for great content.
I’ve selected the custom plugin method as I’ll have more control on what will run. strangely when I tried to enable the plugin I got the error for last line (below).
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected end of file in *****/google-analytics.php on line 25
So I’ve edited the script as below and now I can enable the plugin without error and the lines shows up in (page source) as well.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘********’);
May I ask if there’s any issue with my edit or if it’s ok?
Again thanks for your great content and sharing.
Nick Schäferhoff
Hey Sohrab, to be honest, I don’t really see anything different in your code. Did you only delete the empty line between the gtag declarations? If so, it shouldn’t make any difference. Be sure to check whether your tracking works though, this will tell you if you have implemented it correctly.
Damian Dunphy
Thanks Nick awesome article, used custom plugin method which worked as expected. One note there is a missing close php tag %> in the code snippet on page.
Thanks again.
Damian
Nick Schäferhoff
Thanks for pointing that out, I corrected it now.
Sofa Surfer
Hi Nick, all this seems to work for Business plans only. I have a Premium plan (for freelancers) and cannot install plugins, cannot access header.php and cannot upload custom-made plugins. Any help? Many thanks!
Nick Schäferhoff
Hey, it sounds like you are on WordPress.com but the instructions above are for WordPress.org sites. Please check this article to understand the differences: https://websitesetup.org/wordpress-com-vs-wordpress-org/
Dave Hayler
Thanks so much for this article – it was everything I needed to get me set up and the instructions were excellent. I’ve set up the two websites I handle and it was completely painless! Thanks again.
Nick Schäferhoff
Thank YOU for the kind feedback, Dave!
Ramod
-When I make my own plugin, what should I enter to;
1. Plugin URL:
2. Version:
-What is meant by number 10 in the last sentence?
add_action( ‘wp_head’, ‘ns_google_analytics’, 10 );
Please help me.
WebsiteSetup Editorial
Don’t worry about the URL or version, they’re just comments in the code to help you keep track of things – they don’t affect the code in any way. 10 is the level of priority for the function, meaning when it should be executed. 10 is the default value, so just leave it as it is.
sahasra
What i observed is, if i use analytics with plugin and manual it is showing a low bounce rate. When I use google analytics either manually or custom it is showing a high bounce rate. Which one is correct?
Nick Schäferhoff
You should only ever use one method at a time to connect your website to Google Analytics. Adding more than one tracking code will distort your data. That’s probably the reason why your bounce rate is lower when you use both kinds of implementation. So, you should definitely remove one of them.
Grateful
Thank you. Was struggling with getting the code to work on my blog which is a subdirectory of my main domain…the report was not showing the pages visitted…just a “/”.
So I deleted monsterinsights and Site Kit by Google, and added the script manually using functions.php tactic you mentioned above. And the page URLs now show up.
Keep up the great work.
Nick Schäferhoff
Sounds like you did a great job! Happy to be of service!
Nadia
Hi Nick,
Thank you for sharing this valuable content! I really appreciate it!
Only i got lost in the beginning…where do I find the ¨ header.php file¨ ?
Regards,
Nadia
Karen
Nadia: Go to Appearance->Theme Editor, and look through the section on the right side that says “Theme Files”. Most themes have a file called header.php, although it’s not a guarantee. [Note: If right under “Theme Files” it says, “This child theme inherits…”, it means you are already using a child theme, so if you don’t see header.php in the list, select the parent theme and look again.]
As Nick said, if you are not already using a child theme, you should do so before editing theme files, so that you won’t lose your customizations. You can even use a plugin to set up the child theme for you (and delete it when you’re done – you don’t have to keep it running) – I know how to make a child theme manually, but I use the “Child Theme Configurator” plugin to save time. Once you have a child theme, copy header.php from the parent to the child and add the Google code.
Teo Dumi
Awesome, your functions.php method worked! Kudos!
Nick Schäferhoff
Hey Nadia, you find the file in your theme directory (wp-content/themes). If you make changes to it, be sure to create a child theme, otherwise you will lose your modifications to your next theme update. Alternatively, you could also use a plugin that allows you to include scripts in your header or footer from the WordPress back end, such as https://wordpress.org/plugins/header-and-footer-scripts/.
dim mar
Hello! How can we add a subdomain site to content reports in Google Analytics? Should we create a new account for google analytics? Or can we add it to the main account by adding some filters or exclusions? There is the main site now (mysite.com) and we want to add the GA code to an e-commerce WordPress site on a subdomain (store.mysite.com).
Nick Schäferhoff
Hey Dimitri, this is a somewhat complex topic and you can find help for it here: https://www.directom.com/google-analytics-subdomain-tracking/
Lu
I am wondering what the Tracking ID number is for? Does this need to go into the code? I only posted the Global Site Tag (gtag.js) in my code.
Nick Schäferhoff
The tracking ID number is inside your gtag.js script. It’s what connect your site to your Google Analytics account so Google knows which account to attribute the traffic to.
Fritz
I have installed Google Analytics Dashboard for WP (GADWP) on my wordpress website. I believe I followed each step, but the Insights do not appear on my WordPress dashboard. What could I have done wrong?
Nick Schäferhoff
Hey Fritz, one thing you can check is if the plugin metaboxes are disabled in the Screen Options. You can find them at the top right of your dashboard. Just click to open the menu and see if the information you want to see is unchecked. IF that doesn’t help, it’s best to ask the plugin developer. Cheers!
David Cornish
Is it okay to have the Yoast SEO plug in AND monster Insights, or should I get rid of the plug in? (I was finding it difficult anyways and don’t think I have it set up properly)
Nick Schäferhoff
Hey David, it is ok to have both plugins on your site since they both have very different functions. However, if you feel like they are slowing down your site (since both of them are rather large and complex), you could reconsider using both at the same time. Hope this helps!
Shannon
How to install this custom plugin via cpanel? I get an error when I try to upload it zipped or unzipped.
zipped error:
Unpacking the package…
The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
unzipped error:
The package could not be installed. No valid plugins were found.
Plugin installation failed
Nick Schäferhoff
Hey Shannon, you don’t need to zip the custom plugin. Just upload the file to wp-content/plugins. You can also give it its own subfolder like custom-google-analytics. Once placed there, you should see it in your WordPress back end.
Hope
I’m running into this same issue. I’m trying to upload through the wordpress user interface. (…/wp-admin/plugin-install.php)
This upload option is restricted to .zip files.
How do I upload to wp-content/plugins?
Nick Schäferhoff
Sounds like you are trying to upload the files as they are. You need to turn them into a zip file to upload them. To upload to wp-content/plugins, you need to log into your server via FTP.