Should we noindex our JSON files?

We use a lot of AJAX that loads JSON files that return an application/json mime type. In some instances, these JSON files are used to assemble elements on the page, so we don't want to hide them from Google because we want Google to see the page fully rendered.

My question is whether we should be adding an X-Robots-Tag: noindex HTTP header to these JSON files. On one hand, we don't want them returned in the search results because they're JSON files. On the other hand, these files are used as building blocks to build the page we do want indexed, and therefore should be included in Google's cache the same way Google's cache includes our CSS and JS files. We wouldn't noindex our CSS, after all. Right?

Future of Web Development: Trends and Tools

Hey everyone! Web development is evolving rapidly with exciting trends like Progressive Web Apps (PWAs), Jamstack architecture, and AI integration. What tools and frameworks are you using? How do you tackle challenges like responsive design, performance optimization, and security? Share your experiences and tips!

Cheers,
Haseeb Ahmad:

How to Upload an HTML Page to WordPress Without 404 Errors

WordPress is typically used to create blog posts and pages for your website. However, some users may need to add a separate static HTML page and make it accessible along with their general WordPress site.

The problem is that this page is not recognized by WordPress, and it may show a 404 error.

In this article, we will show you how to properly upload an HTML page to WordPress without causing a 404 error.

How to upload an HTML page to WordPress

Why Upload HTML Pages to WordPress?

WordPress comes with a built-in content type to add pages to your website. Often, WordPress themes add pre-designed page templates to display your pages.

There are even WordPress landing page plugins that allow you to create beautiful page templates with a drag-and-drop builder.

This means that, in most cases, you shouldn’t need to upload an HTML page to your WordPress site.

Expert Tip: We recommend using SeedProd, the best WordPress page builder plugin, to design custom pages. You can use its drag-and-drop interface to design your landing page. Plus, it comes with professionally designed templates to use as starting points.

SeedProd page builder

However, sometimes, you may have static HTML pages from your old website or a static template that you like and want to use.

In these scenarios, you will need to upload your HTML page to WordPress.

Since WordPress comes with its own SEO-friendly URL structure, it may cause a 404 error if you simply upload your HTML page and try to access it.

That being said, let’s look at how to upload an HTML page to your WordPress site without causing 404 errors.

Uploading HTML Page to WordPress Site

First, you need to prepare the HTML page that you want to upload.

If it is a single HTML page with no separate CSS or image files, then you can go ahead and upload it as is.

However, if the page you want to upload has separate CSS files and images, then you need to place them in a directory structure.

Ideally, you would want to place your files in a folder on your computer.

Arrange HTML page

Don’t forget to open your main HTML file to make sure that everything works as expected.

Next, you need to connect to your WordPress site using an FTP client or the File Manager app in your hosting account control panel.

After that, you need to upload the folder you created earlier to the root folder of your WordPress website. The root folder is the one that has the wp-admin, wp-content, and wp-includes folders inside it.

Upload files

After uploading your files, you can go to your website to view your HTML page.

If you uploaded the folder with HTML and accompanying CSS and image files, then you will need to add the name of the folder you uploaded to the end of your website address, like this:

https://example.com/landing-page/

Note: The main HTML file in your folder should be called index.html. Otherwise, you will have to provide the name of the HTML file, too.

On the other hand, if you uploaded a standalone HTML file, then simply add the HTML filename to the end of your website address:

https://example.com/landing-page.html

You will now see your uploaded HTML page.

If you run into an error page, then you will need to troubleshoot the error.

Troubleshooting HTML Page Upload in WordPress

Normally, you should be able to view your HTML page by visiting the page or folder directly.

However, due to the rewrite rules used by WordPress or your web server, there is a chance that you may run into some common WordPress errors.

1. Fixing 404 Error After HTML Page Upload in WordPress

The 404 error is one of the most common WordPress errors. However, it is quite easy to fix in most cases.

If you are seeing a 404 error after uploading your HTML page, then you just need to add a rewrite rule to your .htaccess file:

RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L]

2. Fixing 403 Error After Uploading an HTML Page in WordPress

A 403 error may also occur due to file permissions on your newly uploaded HTML page or the folder that you uploaded.

Simply connect to your website using an FTP client and click to select the HTML page or the folder you uploaded.

Next, right-click and then select the ‘File permissions’ option in your FTP client.

Open file permissions

This will bring up a file permission popup. Enter ‘755’ into the numeric value field and check the ‘Recurse into subdirectories’ option.

Below that, select the ‘Apply to all files and directory’ option and click on the ‘OK’ button.

File permissions checkbox

This will set the file permissions for your HTML upload folder and all the files and folders inside it.

For more details, see our tutorial on how to fix file and folder permissions error in WordPress.

Adding Your Custom HTML Page to XML Sitemaps

Now that you have uploaded your HTML page, it is time to let search engines know that it is part of your website.

The easiest way to do that is by adding it to the XML sitemaps for your website.

If you haven’t set up sitemaps yet, then follow the instructions in our article on how to add XML sitemaps in WordPress.

First, you’ll need to install and activate the All in One SEO for WordPress plugin. For more details, see our article on how to install a WordPress plugin.

Upon activation, go to the All in One SEO » Sitemaps page. Under the General Settings page, make sure that the ‘Enable Sitemap’ toggle is turned on.

AIOSEO sitemaps

After that, scroll down a little to the Additional Pages section.

Slide the toggle to activate this section and then enter your HTML page or folder URL under the ‘Page URL’ option.

Add page URL

Click on the ‘Add Page’ button to add it.

After that, don’t forget to click on the ‘Save Changes’ button to store your settings.

All in One SEO will now include your custom HTML page URL in your WordPress XML sitemaps. Search engines will be able to find the URL and treat it as any other page from your website.

We hope this article helped you learn how to upload an HTML page to WordPress without causing errors. You may also want to see our WordPress SEO guide to get more traffic or take a look at our beginner’s guide to WordPress speed and performance.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Upload an HTML Page to WordPress Without 404 Errors first appeared on WPBeginner.

Modern CSS Layouts: You Might Not Need A Framework For That

Establishing layouts in CSS is something that we, as developers, often delegate to whatever framework we’re most comfortable using. And even though it’s possible to configure a framework to get just what we need out of it, how often have you integrated an entire CSS library simply for its layout features? I’m sure many of us have done it at some point, dating back to the days of 960.gs, Bootstrap, Susy, and Foundation.

Modern CSS features have significantly cut the need to reach for a framework simply for its layout. Yet, I continue to see it happen. Or, I empathize with many of my colleagues who find themselves re-creating the same Grid or Flexbox layout over and over again.

In this article, we will gain greater control over web layouts. Specifically, we will create four CSS classes that you will be able to take and use immediately on just about any project or place where you need a particular layout that can be configured to your needs.

While the concepts we cover are key, the real thing I want you to take away from this is the confidence to use CSS for those things we tend to avoid doing ourselves. Layouts used to be a challenge on the same level of styling form controls. Certain creative layouts may still be difficult to pull off, but the way CSS is designed today solves the burdens of the established layout patterns we’ve been outsourcing and re-creating for many years.

What We’re Making

We’re going to establish four CSS classes, each with a different layout approach. The idea is that if you need, say, a fluid layout based on Flexbox, you have it ready. The same goes for the three other classes we’re making.

And what exactly are these classes? Two of them are Flexbox layouts, and the other two are Grid layouts, each for a specific purpose. We’ll even extend the Grid layouts to leverage CSS Subgrid for when that’s needed.

Within those two groups of Flexbox and Grid layouts are two utility classes: one that auto-fills the available space — we’re calling these “fluid” layouts — and another where we have greater control over the columns and rows — we’re calling these “repeating” layouts.

Finally, we’ll integrate CSS Container Queries so that these layouts respond to their own size for responsive behavior rather than the size of the viewport. Where we’ll start, though, is organizing our work into Cascade Layers, which further allow you to control the level of specificity and prevent style conflicts with your own CSS.

Setup: Cascade Layers & CSS Variables

A technique that I’ve used a few times is to define Cascade Layers at the start of a stylesheet. I like this idea not only because it keeps styles neat and organized but also because we can influence the specificity of the styles in each layer by organizing the layers in a specific order. All of this makes the utility classes we’re making easier to maintain and integrate into your own work without running into specificity battles.

I think the following three layers are enough for this work:

@layer reset, theme, layout;

Notice the order because it really, really matters. The reset layer comes first, making it the least specific layer of the bunch. The layout layer comes in at the end, making it the most specific set of styles, giving them higher priority than the styles in the other two layers. If we add an unlayered style, that one would be added last and thus have the highest specificity.

Related: “Getting Started With Cascade Layers” by Stephanie Eckles.

Let’s briefly cover how we’ll use each layer in our work.

Reset Layer

The reset layer will contain styles for any user agent styles we want to “reset”. You can add your own resets here, or if you already have a reset in your project, you can safely move on without this particular layer. However, do remember that un-layered styles will be read last, so wrap them in this layer if needed.

I’m just going to drop in the popular box-sizing declaration that ensures all elements are sized consistently by the border-box in accordance with the CSS Box Model.

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  body {
    margin: 0;
  }
}

Theme Layer

This layer provides variables scoped to the :root element. I like the idea of scoping variables this high up the chain because layout containers — like the utility classes we’re creating — are often wrappers around lots of other elements, and a global scope ensures that the variables are available anywhere we need them. That said, it is possible to scope these locally to another element if you need to.

Now, whatever makes for “good” default values for the variables will absolutely depend on the project. I’m going to set these with particular values, but do not assume for a moment that you have to stick with them — this is very much a configurable system that you can adapt to your needs.

Here are the only three variables we need for all four layouts:

@layer theme {
  :root {
    --layout-fluid-min: 35ch;
    --layout-default-repeat: 3;
    --layout-default-gap: 3vmax;
  }
}

In order, these map to the following:

Notice: The variables are prefixed with layout-, which I’m using as an identifier for layout-specific values. This is my personal preference for structuring this work, but please choose a naming convention that fits your mental model — naming things can be hard!

Layout Layer

This layer will hold our utility class rulesets, which is where all the magic happens. For the grid, we will include a fifth class specifically for using CSS Subgrid within a grid container for those possible use cases.

@layer layout {  
  .repeating-grid {}
  .repeating-flex {}
  .fluid-grid {}
  .fluid-flex {}

  .subgrid-rows {}
}

Now that all our layers are organized, variables are set, and rulesets are defined, we can begin working on the layouts themselves. We will start with the “repeating” layouts, one based on CSS Grid and the other using Flexbox.

Repeating Grid And Flex Layouts

I think it’s a good idea to start with the “simplest” layout and scale up the complexity from there. So, we’ll tackle the “Repeating Grid” layout first as an introduction to the overarching technique we will be using for the other layouts.

Repeating Grid

If we head into the @layout layer, that’s where we’ll find the .repeating-grid ruleset, where we’ll write the styles for this specific layout. Essentially, we are setting this up as a grid container and applying the variables we created to it to establish layout columns and spacing between them.

.repeating-grid {
  display: grid;
  grid-template-columns: repeat(var(--layout-default-repeat), 1fr);
  gap: var(--layout-default-gap);
}

It’s not too complicated so far, right? We now have a grid container with three equally sized columns that take up one fraction (1fr) of the available space with a gap between them.

This is all fine and dandy, but we do want to take this a step further and turn this into a system where you can configure the number of columns and the size of the gap. I’m going to introduce two new variables scoped to this grid:

  • --_grid-repeat: The number of grid columns.
  • --_repeating-grid-gap: The amount of space between grid items.

Did you notice that I’ve prefixed these variables with an underscore? This was actually a JavaScript convention to specify variables that are “private” — or locally-scoped — before we had const and let to help with that. Feel free to rename these however you see fit, but I wanted to note that up-front in case you’re wondering why the underscore is there.

.repeating-grid {
  --_grid-repeat: var(--grid-repeat, var(--layout-default-repeat));
  --_repeating-grid-gap: var(--grid-gap, var(--layout-default-gap));

  display: grid;
  grid-template-columns: repeat(var(--layout-default-repeat), 1fr);
  gap: var(--layout-default-gap);
}

Notice: These variables are set to the variables in the @theme layer. I like the idea of assigning a global variable to a locally-scoped variable. This way, we get to leverage the default values we set in @theme but can easily override them without interfering anywhere else the global variables are used.

Now let’s put those variables to use on the style rules from before in the same .repeating-grid ruleset:

.repeating-grid {
  --_grid-repeat: var(--grid-repeat, var(--layout-default-repeat));
  --_repeating-grid-gap: var(--grid-gap, var(--layout-default-gap));

  display: grid;
  grid-template-columns: repeat(var(--_grid-repeat), 1fr);
  gap: var(--_repeating-grid-gap);
}

What happens from here when we apply the .repeating-grid to an element in HTML? Let’s imagine that we are working with the following simplified markup:

<section class="repeating-grid">
  <div></div>
  <div></div>
  <div></div>
</section>

If we were to apply a background-color and height to those divs, we would get a nice set of boxes that are placed into three equally-sized columns, where any divs that do not fit on the first row automatically wrap to the next row.

Time to put the process we established with the Repeating Grid layout to use in this Repeating Flex layout. This time, we jump straight to defining the private variables on the .repeating-flex ruleset in the @layout layer since we already know what we’re doing.

.repeating-flex {
  --_flex-repeat: var(--flex-repeat, var(--layout-default-repeat));
  --_repeating-flex-gap: var(--flex-gap, var(--layout-default-gap));
}

Again, we have two locally-scoped variables used to override the default values assigned to the globally-scoped variables. Now, we apply them to the style declarations.

.repeating-flex {
  --_flex-repeat: var(--flex-repeat, var(--layout-default-repeat));
  --_repeating-flex-gap: var(--flex-gap, var(--layout-default-gap));

  display: flex;
  flex-wrap: wrap;
  gap: var(--_repeating-flex-gap);
}

We’re only using one of the variables to set the gap size between flex items at the moment, but that will change in a bit. For now, the important thing to note is that we are using the flex-wrap property to tell Flexbox that it’s OK to let additional items in the layout wrap into multiple rows rather than trying to pack everything in a single row.

But once we do that, we also have to configure how the flex items shrink or expand based on whatever amount of available space is remaining. Let’s nest those styles inside the parent ruleset:

.repeating-flex {
  --_flex-repeat: var(--flex-repeat, var(--layout-default-repeat));
  --_repeating-flex-gap: var(--flex-gap, var(--layout-default-gap));

  display: flex;
  flex-wrap: wrap;
  gap: var(--_repeating-flex-gap);

  > * {
    flex: 1 1 calc((100% / var(--_flex-repeat)) - var(--_gap-repeater-calc));
  }
}

If you’re wondering why I’m using the universal selector (*), it’s because we can’t assume that the layout items will always be divs. Perhaps they are <article> elements, <section>s, or something else entirely. The child combinator (>) ensures that we’re only selecting elements that are direct children of the utility class to prevent leakage into other ancestor styles.

The flex shorthand property is one of those that’s been around for many years now but still seems to mystify many of us. Before we unpack it, did you also notice that we have a new locally-scoped --_gap-repeater-calc variable that needs to be defined? Let’s do this:

.repeating-flex {
  --_flex-repeat: var(--flex-repeat, var(--layout-default-repeat));
  --_repeating-flex-gap: var(--flex-gap, var(--layout-default-gap));

  /* New variables */
  --_gap-count: calc(var(--_flex-repeat) - 1);
  --_gap-repeater-calc: calc(
    var(--_repeating-flex-gap) / var(--_flex-repeat) * var(--_gap-count)
  );

  display: flex;
  flex-wrap: wrap;
  gap: var(--_repeating-flex-gap);

  > * {
    flex: 1 1 calc((100% / var(--_flex-repeat)) - var(--_gap-repeater-calc));
  }
}

Whoa, we actually created a second variable that --_gap-repeater-calc can use to properly calculate the third flex value, which corresponds to the flex-basis property, i.e., the “ideal” size we want the flex items to be.

If we take out the variable abstractions from our code above, then this is what we’re looking at:

.repeating-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 3vmax

  > * {
    flex: 1 1 calc((100% / 3) - calc(3vmax / 3 * 2));
  }
}

Hopefully, this will help you see what sort of math the browser has to do to size the flexible items in the layout. Of course, those values change if the variables’ values change. But, in short, elements that are direct children of the .repeating-flex utility class are allowed to grow (flex-grow: 1) and shrink (flex-shrink: 1) based on the amount of available space while we inform the browser that the initial size (i.e., flex-basis) of each flex item is equal to some calc()-ulated value.

Because we had to introduce a couple of new variables to get here, I’d like to at least explain what they do:

  • --_gap-count: This stores the number of gaps between layout items by subtracting 1 from --_flex-repeat. There’s one less gap in the number of items because there’s no gap before the first item or after the last item.
  • --_gap-repeater-calc: This calculates the total gap size based on the individual item’s gap size and the total number of gaps between items.

From there, we calculate the total gap size more efficiently with the following formula:

calc(var(--_repeating-flex-gap) / var(--_flex-repeat) * var(--_gap-count))

Let’s break that down further because it’s an inception of variables referencing other variables. In this example, we already provided our repeat-counting private variable, which falls back to the default repeater by setting the --layout-default-repeat variable.

This sets a gap, but we’re not done yet because, with flexible containers, we need to define the flex behavior of the container’s direct children so that they grow (flex-grow: 1), shrink (flex-shrink: 1), and with a flex-basis value that is calculated by multiplying the repeater by the total number of gaps between items.

Next, we divide the individual gap size (--_repeating-flex-gap) by the number of repetitions (--_flex-repeat)) to equally distribute the gap size between each item in the layout. Then, we multiply that gap size value by one minus the total number of gaps with the --_gap-count variable.

And that concludes our repeating grids! Pretty fun, or at least interesting, right? I like a bit of math.

Before we move to the final two layout utility classes we’re making, you might be wondering why we want so many abstractions of the same variable, as we start with one globally-scoped variable referenced by a locally-scoped variable which, in turn, can be referenced and overridden again by yet another variable that is locally scoped to another ruleset. We could simply work with the global variable the whole time, but I’ve taken us through the extra steps of abstraction.

I like it this way because of the following:

  1. I can peek at the HTML and instantly see which layout approach is in use: .repeating-grid or .repeating-flex.
  2. It maintains a certain separation of concerns that keeps styles in order without running into specificity conflicts.

See how clear and understandable the markup is:

<section class="repeating-flex footer-usps">
  <div></div>
  <div></div>
  <div></div>
</section>

The corresponding CSS is likely to be a slim ruleset for the semantic .footer-usps class that simply updates variable values:

.footer-usps {
  --flex-repeat: 3;
  --flex-gap: 2rem;
}

This gives me all of the context I need: the type of layout, what it is used for, and where to find the variables. I think that’s handy, but you certainly could get by without the added abstractions if you’re looking to streamline things a bit.

Fluid Grid And Flex Layouts

All the repeating we’ve done until now is fun, and we can manipulate the number of repeats with container queries and media queries. But rather than repeating columns manually, let’s make the browser do the work for us with fluid layouts that automatically fill whatever empty space is available in the layout container. We may sacrifice a small amount of control with these two utilities, but we get to leverage the browser’s ability to “intelligently” place layout items with a few CSS hints.

Fluid Grid

Once again, we’re starting with the variables and working our way to the calculations and style rules. Specifically, we’re defining a variable called --_fluid-grid-min that manages a column’s minimum width.

Let’s take a rather trivial example and say we want a grid column that’s at least 400px wide with a 20px gap. In this situation, we’re essentially working with a two-column grid when the container is greater than 820px wide. If the container is narrower than 820px, the column stretches out to the container’s full width.

If we want to go for a three-column grid instead, the container’s width should be about 1240px wide. It’s all about controlling the minimum sizing values in the gap.

.fluid-grid {
  --_fluid-grid-min: var(--fluid-grid-min, var(--layout-fluid-min));
  --_fluid-grid-gap: var(--grid-gap, var(--layout-default-gap));
}

That establishes the variables we need to calculate and set styles on the .fluid-grid layout. This is the full code we are unpacking:

 .fluid-grid {
  --_fluid-grid-min: var(--fluid-grid-min, var(--layout-fluid-min));
  --_fluid-grid-gap: var(--grid-gap, var(--layout-default-gap));

  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(var(--_fluid-grid-min), 100%), 1fr)
  );
  gap: var(--_fluid-grid-gap);
}

The display is set to grid, and the gap between items is based on the --fluid-grid-gap variable. The magic is taking place in the grid-template-columns declaration.

This grid uses the repeat() function just as the .repeating-grid utility does. By declaring auto-fit in the function, the browser automatically packs in as many columns as it possibly can in the amount of available space in the layout container. Any columns that can’t fit on a line simply wrap to the next line and occupy the full space that is available there.

Then there’s the minmax() function for setting the minimum and maximum width of the columns. What’s special here is that we’re nesting yet another function, min(), within minmax() (which, remember, is nested in the repeat() function). This a bit of extra logic that sets the minimum width value of each column somewhere in a range between --_fluid-grid-min and 100%, where 100% is a fallback for when --_fluid-grid-min is undefined or is less than 100%. In other words, each column is at least the full 100% width of the grid container.

The “max” half of minmax() is set to 1fr to ensure that each column grows proportionally and maintains equally sized columns.

See the Pen Fluid grid [forked] by utilitybend.

That’s it for the Fluid Grid layout! That said, please do take note that this is a strong grid, particularly when it is combined with modern relative units, e.g. ch, as it produces a grid that only scales from one column to multiple columns based on the size of the content.

Fluid Flex

We pretty much get to re-use all of the code we wrote for the Repeating Flex layout for the Fluid Flex layout, but only we’re setting the flex-basis of each column by its minimum size rather than the number of columns.

.fluid-flex {
  --_fluid-flex-min: var(--fluid-flex-min, var(--layout-fluid-min));
  --_fluid-flex-gap: var(--flex-gap, var(--layout-default-gap));

  display: flex;
  flex-wrap: wrap;
  gap: var(--_fluid-flex-gap);

  > * {
    flex: 1 1 var(--_fluid-flex-min);
  }
}

That completes the fourth and final layout utility — but there’s one bonus class we can create to use together with the Repeating Grid and Fluid Grid utilities for even more control over each layout.

Optional: Subgrid Utility

Subgrid is handy because it turns any grid item into a grid container of its own that shares the parent container’s track sizing to keep the two containers aligned without having to redefine tracks by hand. It’s got full browser support and makes our layout system just that much more robust. That’s why we can set it up as a utility to use with the Repeating Grid and Fluid Grid layouts if we need any of the layout items to be grid containers for laying out any child elements they contain.

Here we go:

.subgrid-rows {
  > * {
    display: grid;
    gap: var(--subgrid-gap, 0);
    grid-row: auto / span var(--subgrid-rows, 4);
    grid-template-rows: subgrid;
  }
}

We have two new variables, of course:

  • --subgrid-gap: The vertical gap between grid items.
  • --subgrid-rows The number of grid rows defaulted to 4.

We have a bit of a challenge: How do we control the subgrid items in the rows? I see two possible methods.

Method 1: Inline Styles

We already have a variable that can technically be used directly in the HTML as an inline style:

<section class="fluid-grid subgrid-rows" style="--subgrid-rows: 4;">
  <!-- items -->
</section>

This works like a charm since the variable informs the subgrid how much it can grow.

Method 2: Using The :has() Pseudo-Class

This approach leads to verbose CSS, but sacrificing brevity allows us to automate the layout so it handles practically anything we throw at it without having to update an inline style in the markup.

Check this out:

.subgrid-rows {
  &:has(> :nth-child(1):last-child) { --subgrid-rows: 1; }
  &:has(> :nth-child(2):last-child) { --subgrid-rows: 2; }
  &:has(> :nth-child(3):last-child) { --subgrid-rows: 3; }
  &:has(> :nth-child(4):last-child) { --subgrid-rows: 4; }
  &:has(> :nth-child(5):last-child) { --subgrid-rows: 5; }
  /* etc. */

  > * {
    display: grid;
    gap: var(--subgrid-gap, 0);
    grid-row: auto / span var(--subgrid-rows, 5);
    grid-template-rows: subgrid;
  }
}

The :has() selector checks if a subgrid row is the last child item in the container when that item is either the first, second, third, fourth, fifth, and so on item. For example, the second declaration:

&:has(> :nth-child(2):last-child) { --subgrid-rows: 2; }

…is pretty much saying, “If this is the second subgrid item and it happens to be the last item in the container, then set the number of rows to 2.”

Whether this is too heavy-handed, I don’t know; but I love that we’re able to do it in CSS.

The final missing piece is to declare a container on our children. Let’s give the columns a general class name, .grid-item, that we can override if we need to while setting each one as a container we can query for the sake of updating its layout when it is a certain size (as opposed to responding to the viewport’s size in a media query).

:is(.fluid-grid:not(.subgrid-rows),
.repeating-grid:not(.subgrid-rows),
.repeating-flex, .fluid-flex) {
    > * {
    container: var(--grid-item-container, grid-item) / inline-size;
  }
}

That’s a wild-looking selector, but the verbosity is certainly kept to a minimum thanks to the :is() pseudo-class, which saves us from having to write this as a larger chain selector. It essentially selects the direct children of the other utilities without leaking into .subgrid-rows and inadvertently selecting its direct children.

The container property is a shorthand that combines container-name and container-type into a single declaration separated by a forward slash (/). The name of the container is set to one of our variables, and the type is always its inline-size (i.e., width in a horizontal writing mode).

The container-type property can only be applied to grid containers — not grid items. This means we’re unable to combine it with the grid-template-rows: subgrid value, which is why we needed to write a more complex selector to exclude those instances.

Demo

Check out the following demo to see how everything comes together.

See the Pen Grid system playground [forked] by utilitybend.

The demo is pulling in styles from another pen that contains the full CSS for everything we made together in this article. So, if you were to replace the .fluid-flex classname from the parent container in the HTML with another one of the layout utilities, the layout will update accordingly, allowing you to compare them.

Those classes are the following:

  • .repeating-grid,
  • .repeating-flex,
  • .fluid-grid,
  • .fluid-flex.

And, of course, you have the option of turning any grid items into grid containers using the optional .subgrid-rows class in combination with the .repeating-grid and .fluid-grid utilities.

Conclusion: Write Once And Repurpose

This was quite a journey, wasn’t it? It might seem like a lot of information, but we made something that we only need to write once and can use practically anywhere we need a certain type of layout using modern CSS approaches. I strongly believe these utilities can not only help you in a bunch of your work but also cut any reliance on CSS frameworks that you may be using simply for its layout configurations.

This is a combination of many techniques I’ve seen, one of them being a presentation Stephanie Eckles gave at CSS Day 2023. I love it when people handcraft modern CSS solutions for things we used to work around. Stephanie’s demonstration was clean from the start, which is refreshing as so many other areas of web development are becoming ever more complex.

After learning a bunch from CSS Day 2023, I played with Subgrid on my own and published different ideas from my experiments. That’s all it took for me to realize how extensible modern CSS layout approaches are and inspired me to create a set of utilities I could rely on, perhaps for a long time.

By no means am I trying to convince you or anyone else that these utilities are perfect and should be used everywhere or even that they’re better than <framework-du-jour>. One thing that I do know for certain is that by experimenting with the ideas we covered in this article, you will get a solid feel of how CSS is capable of making layout work much more convenient and robust than ever.

Create something out of this, and share it in the comments if you’re willing — I’m looking forward to seeing some fresh ideas!

SAKO Architects’ Vibrant Buildings Will Take You to Colorful Paradise

Founded by visionary architect Keiichiro Sako, SAKO Architects grew into one of Asia’s most inventive architecture firms in the past two decades. They’re taking the world by storm with their colorful buildings, and here are three that have to be seen to be believed. Kaleidoscope – Tianshui SAKO Architects built several educational centers all around […]

A Better Google Analytics Alternative

Fullres

Our recent migration to GA4 left a lot to be desired and led us to explore for better google analytics alternatives. We tried just about everything out there, including Plausible, Fathom, and several others, all with their own pros and cons. The biggest hurdles were: limited features and higher costs.

That’s why we were so excited when we stumbled across Fullres recently. Not only do they have the best pricing around but they’re bundling multiple tools we use—ad revenue, analytics, web vitals—all into a single platform. Usually, you have to subscribe to multiple services and jump between browser tabs to see that amount of data together. Looking at their roadmap, there’s a lot more coming too.

Fullres also stood out with their quick 5-second installation setup. You get instant access to audience statistics in a GDPR-compliant manner and built-in Web Vitals data to continuously improve key metrics such as First Contentful Paint (FCP), Largest Contentful Paint (LCP), and other more.

For those who found the switch to GA4 challenging, Fullres is worth a try. It’s currently invite-only, so join the waitlist as soon as possible to get early access.

7 Best Crowdfunding Plugins for WordPress

At WPBeginner, we’ve helped many nonprofit and small business projects get off the ground, and we’ve seen how the right crowdfunding tools can make all the difference.

Sifting through the many crowdfunding plugins for WordPress can be a headache, and let’s face it: not all plugins are up to par. The right tool allows you to easily launch and scale your campaigns with minimal difficulty or fees.

That’s why we’ve done the research and put together a list of the best WordPress crowdfunding plugins so that you can find the right fit for your next venture.

Best Crowdfunding Plugins for WordPress

What Is a Crowdfunding Plugin, and Why Do You Need One?

Fundraising can be a challenge, especially for entrepreneurs and small businesses. You might have the perfect business plan and website, but that doesn’t matter if you don’t have the funds to start it.

That’s where crowdfunding comes in. It involves raising awareness about a new business venture that you are considering developing and getting small contributions from people.

Rather than go to sites like Kickstarter and IndieGoGo, which take a cut of your funds and restrict your ability to add customizations, a crowdfunding plugin gives you full control.

There are many advantages to crowdfunding in WordPress, such as:

  • Access to capital: Crowdfunding allows you to get access to capital when it may not be feasible or easy to secure funding from traditional sources like banks or other lenders.
  • Market validation: By presenting your idea to the public, you can gauge the interest and see if your product is something that people would actually pay for. For example, you can accept donations and include a survey form so that your team can collect valuable feedback from contributors.
  • Audience building: Crowdfunding allows you to reach a large number of people so you can generate awareness and build an audience. Those who contribute to your campaign will likely be loyal customers and advocates. It’s a good idea to use a plugin like MemberPress so you can give contributors a place to share their thoughts and ideas in a private forum.
  • Customization: You have control over your enter campaign design and branding. You can even combine other plugins to help boost your crowdfunding efforts. For example, you could use other plugins like RafflePress to incentivize others to share your campaign to increase awareness.
  • Data ownership: When you choose WordPress, you own the data. You can build your email list with plugins like OptinMonster, which allows you to send updates to your subscribers about your new business venture.

With all said, let’s dive into the best tools building for starting your crowdfunding campaigns.

1. Charitable

Charitable

Out of all the options we tried, Charitable is the best crowdfunding plugin for WordPress. It allows you to create peer-to-peer fundraising campaigns without using a separate hosted fundraising platform, and it doesn’t charge transaction fees.

It allows you to easily build attractive fundraising pages and forms on your website. Plus, it lets you set up peer-to-peer fundraising and build brand awareness much faster, which ultimately can get you more funding for your business venture.

Charitable offers a wide range of add-ons, making it possible to handle just about any use case. For example, you can find addons like Donor Comments to add testimonials. You can also add a video introducing what your new business project is all about. It’s a great way to get people excited about the idea and increase conversions.

Here’s an example of a video, description, and donation button added to the crowdfunding form on Charitable.

Crowdfunding page example

Charitable comes with other cool extensions like PDF receipts, so contributors can keep their invoices for tax write-offs. Plus, you’re able to connect the plugin to email marketing services so that you can send subscribers updates about your venture, which keeps them informed and excited about what’s going on.

Pricing: Charitable starts at $69 per year. There’s also a free version of the plugin.

Pros:

  • Lots of add-ons to increase functionality
  • Plenty of payment methods
  • Easy to use crowdfunding form editor

Cons:

  • You will need to pay for the premium versions to get access to the add-ons.

Why We Recommend Charitable: Charitable is the best way to raise money with crowdfunding in WordPress. Since you can set up peer-to-peer fundraising, it allows businesses to leverage their networks to reach more people.

2. WP Simple Pay

WP Simple Pay

WP Simple Pay is the best Stripe payments plugin for WordPress. It allows you to easily accept donations and other types of fundraising payments on your site. One of the best things about this plugin is that you won’t need to set up an online store or even a checkout page.

You can build a crowdfunding form and embed it anywhere on your site. Plus, with its advanced form builder, you can customize it however you like. There are plenty of text fields, dropdowns, and price options to add.

WP Simple Pay Form Fields

The flexible donation and fundraising forms offer cool features to help drive more conversions. For example, you can create a predefined suggested donation amount to increase the average donation.

We particularly appreciated how WP Simple Pays offers recurring donations because this allows you to create a steady stream of funding for your organization. Best of all, the plugin accepts 13+ payment methods, so you can appeal to a wide range of donors from around the world.

Pricing: WP Simple Pay starts at $49.50 per year, but there is a free version available as well.

Pros:

  • Accepts 13+ payment methods and multiple currencies.
  • You can provide customizable receipts that help contributors for tax purposes.
  • The advanced form builder is easy to use.

Cons:

  • It doesn’t offer any community-building features.

Why We Recommend WP Simple Pay: We like WP Simple Pay as a quick and easy solution for accepting donations. You can choose to create payment forms or an entire donation page, and the payment process is seamless.

3. GiveWP

GiveWP

GiveWP is another donation plugin for WordPress with a variety of crowdfunding features. Like many of the other plugins on our list, it comes with an easy-to-use form builder so that you can easily customize the donation form without any code.

One of the best aspects of GiveWP is its mobile donation capabilities. Mobile-friendliness is integral for any business, let alone a new venture you’re starting.

The easier you can make it for contributors to donate, the better. GiveWP offers easy-to-pay options like Venmo Donations, Apple Pay, Google Pay, and even Text-to-Give. That means, with a simple text message, donors can easily contribute to your new venture anytime from anywhere.

Inside the plugin dashboard, you’ll receive real-time crowdfunding reports, so you can view metrics like top donors, average donation amounts, and more. This allows you to optimize campaigns and tweak your form or page for better conversions.

Pricing: GiveWP is free to start, but the basic plan starts at $149 per year.

Pros:

  • GiveWP offers a few mobile-pay options.
  • It provides in-depth reporting.
  • Easy-to-use plugin.

Cons:

  • The plan is pricey once you upgrade to the paid version.

Why We Recommend GiveWP: GiveWP is a comprehensive tool that gives you all the essentials for crowdfunding. It’s great if you want to prioritize mobile donations since users can easily pay through texting or popular apps like Venmo.

4. WPForms

WPForms

WPForms is a contact form plugin for WordPress that can accept crowdfunding payments and other transactions. With crowdfunding forms, you can accept donations through a wide range of payment gateways, such as PayPal, Stripe, Square, Authorize.net, and others.

Chances are, if you’re building a new product or business, you’ll need other form types as well. That’s where WPForms excels. You can create forms for all sorts of purposes, like contact forms, newsletter signups, surveys, registration forms, and more. It’s an all-in-one form builder with over 1700+ templates to choose from, which is more than any other plugin on this list.

Out of all the plugins we tried, WPForms is the best for collecting user responses in your crowdfunding forms. That’s because advanced features like the smart logic condition allow you to collect relevant information based on the contributors’ responses.

For example, depending on the contribution level, you may consider adding a reward.

WPForms smart logic

Let’s say VIP contributors will get access to a special launch event. In that case, you’d need to collect information about them so they can RSVP. Or if you’re sending physical rewards like gifts or merchandise, then the smart logic would prompt users to provide their shipping address for delivery purposes.

WPForms comes with a wide range of add-ons like email marketing so you can send donors updates. There are plenty of integrations with third-party apps to enhance functionality. For instance, adding integration with CRM apps allows you to follow up with contributors once your business launches.

Pricing: You can get started with WPForms for $49.50 per year, but there’s also a Lite version.

Pros:

  • WPForms comes with 1,700+ templates.
  • Smart logic is a great option for showing or hiding fields based on responses.
  • There are plenty of third-party integrations to increase functionality.

Cons:

  • It’s not a dedicated crowdfunding platform.

Why We Recommend WPForms: We like WPForms because of its wide range of templates and customizations. Beyond that, smart logic is an excellent way to show only relevant fields, which is great if you offer reward-based crowdfunding.

5. WP Crowdfunding by Themeum

WPCrowdfunding by themeum

WP Crowdfunding is a crowdfunding plugin that leverages the power of WooCommerce to accept and manage pledges from backers.

It’s great because it integrates with all of your other products and categories.

For example, let’s say you have a dropshipping store but want to build your own branded products and start private labeling them. Rather than investing time and resources into products your customers aren’t interested in, you can raise money to help support items that people are willing to pay for.

You can even add all of your crowdfunding campaigns in one place, similar to Kickstarter or Indiegogo. That way, visitors can see which product to support.

Crowdfunding campaigns example

The plugin also has its own Native Wallet system, which tracks all of the proceeds that are raised on the crowdfunding project. That way, you don’t mix up online sales with donations. You’ll get stats along with a list of backers, so you know all the contributions made.

Pricing: WP Crowdfunding costs $149 per year for a single site.

Pros:

  • WP Crowdfunding connects with your WooCommerce store.
  • It helps you decide which products to launch.
  • Backers can donate visibly or anonymously.

Cons:

  • It only uses Stripe.

Why We Recommend WP Crowdfunding: This plugin is a great choice for online stores that want to start selling their products. Visitors can see all of the crowdfunding campaigns available to contribute to and see the progress towards each goal.

6. Formidable Forms

Formidable Forms

Formidable Forms is another form builder plugin, like WPForms. It comes with a wide range of donation forms, payment forms, calculator forms, contact forms, and more.

With this plugin, you can easily create donation and fundraising forms that accept payments via Stripe or Authorize.net. When using Formidable Forms, you’re taken to a visual form styler, giving you plenty of customization options. You can add a donate button, custom amounts, and just about any field you’d like.

While it is a contact form plugin, you can still view donation stats based on all the contributions made. There are beautiful graphic charts that help you visualize your campaign’s performance.

It also has integrations with powerful apps like Zapier, so you can automate workflow tasks. For example, you can set it up so that all contributors receive a thank-you message via email or text.

Overall, we found that Formidable Forms had lots of built-in customization choices. After thorough testing, we do like that it has advanced calculation features. For example, for large donations, you might include a calculator to estimate the tax-deductible portion of the donation.

Pricing: Formidable Forms starts at $39.50 per year but also offers a free version.

Pros:

  • Lots of form templates.
  • A visual form styler to customize the fundraising form to fit your brand identity.
  • Visual reporting to easily see campaign performance.

Cons:

  • It’s not specifically designed for crowdfunding purposes.

Why We Recommend Formidable Forms: This plugin could be a good choice if you need a customizable tool for collecting donations. It supports all the popular payment gateways, and you can add advanced features like calculators to your donation forms.

7. Patreon WordPress

Patreon WordPress plugin

Patreon WordPress is a fundraising plugin that allows you to connect your WordPress site to your Patreon account to boost your pledges and patrons.

Let’s say you already have a built-in audience on Patreon but want your visitors to also have access to your community. Then, you can easily import your existing Patreon posts and content.

The plugin will sync data automatically to WordPress. When donors pledge and subscribe to your Patreon, they can easily access everything from your website.

You might have a new business idea. All contributors can be added to your Patreon community, giving them exclusive access to your gated content. You can choose to restrict any single post or all of your posts. In addition, you can select the tiers or minimum pledge amount needed to access any custom post or type of post.

Pricing: Patreon WordPress is a free plugin.

Pros:

  • Good for creators and existing Patreon users.
  • It syncs from Patreon to WordPress.
  • You can choose to lock or unlock any single post or all posts.

Cons:

  • It’s not useful for anyone who doesn’t plan on using Patreon.

Why We Recommend Patreon WordPress: This is the perfect plugin for creators, artists, musicians, bloggers, and other creatives who are already on Patreon. You’ll be able to bring the power of Patreon onto your website and integrate the platforms.

How Do You Choose the Best Crowdfunding Plugin?

The right crowdfunding plugin will depend on your needs. Some plugins are specifically designed for crowdfunding, while others offer fundraising forms as part of their larger offering.

If you offer other products or services or want to set up different types of forms on your website in addition to the fundraising form, then using an all-in-one plugin could be the more cost-effective solution for you.

Beyond that, it’s vital that you provide donors with a fast and easy checkout experience. That means you should offer a wide range of payment gateways so contributors can pay using their payment method of choice.

If you’re only planning to build a few pages to gauge interest level with any of these plugins, you may want to use SeedProd. It is the best page builder plugin on the market, with a powerful drag-and-drop editor that allows you to easily create any type of page, like a landing page or a custom homepage.

That way, you don’t have to spend time building out your entire website around a particular plugin or system until you have contributors rolling in to support your business idea.

Which Is the Best Crowdfunding Plugin for WordPress?

Through all of our testing, we’ve found that the best crowdfunding plugin for WordPress is Charitable. It has all the tools you need to set up a fundraising campaign. With the peer-to-peer fundraising capability, you can have ambassadors spread the word and increase your donation amount. Beyond that, you can accept recurring donations, connect them to your newsletter software, and more.

If you just want to simply add a crowdfunding feature to your existing website, WP Simple Pay or WPForms are good, cost-effective solutions. You can add a simple crowdfunding payment form to any part of your website and start raising money.

We hope this article helped you find the best crowdfunding plugins for WordPress. You may also want to check out our list of the best WordPress themes for crowdfunding and our guide on how to increase your blog traffic.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 7 Best Crowdfunding Plugins for WordPress first appeared on WPBeginner.