Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Code a Website (Complete Beginner’s Guide)

Most of us on the WPBeginner team can remember staring at our first blank code editor, completely overwhelmed by all the HTML tags, CSS properties, and JavaScript functions we needed to learn.

But that was a long time ago, and since then, we’ve helped thousands of beginners turn that same blank screen into beautiful, functional websites.

Here’s what we’ve learned: coding isn’t just for “tech people.” With the right approach and guidance, anyone can learn to build a website from scratch. We’ve tested and refined our teaching method with students from all backgrounds – from business owners to artists.

In this beginner-friendly guide, we’ll walk you through the entire process of coding your first website, using the same proven method that’s worked countless times before. No technical background required – just bring your willingness to learn.

Coding a website for beginners

Website Builders vs. Coding a Website from Scratch

Back in the early days of the internet, creating a website was a bit of a headache. You basically had to build everything from the ground up using code, which could take ages – think hours, maybe even weeks.

Thankfully, those days are long gone. Now, a whopping 62.9% of all websites are built using website frameworks. This means you don’t need to know how to build a website from scratch anymore.

Most people now use open-source WordPress and other content management systems (website builder frameworks) to help them build websites.

At WPBeginner, we use no-code page builders like WordPress and SeedProd for all our websites. We find them super convenient, easy to customize, and really efficient.

The great news is that in about 95% of cases, you can build a fantastic website using these website builders or no-code solutions.

Pros and Cons of Using a Website Builder

Here are some of the benefits of using a website builder:

  • It is easy to use, even for beginners.
  • You don’t need to invest time and money in learning web development.
  • It saves you time, which you can then spend on growing your business.
  • Easily build eCommerce, membership, and business websites without spending a fortune.

However, there are a few drawbacks to using a website builder:

  • Your website might end up with unnecessary features that slow it down.
  • You may not need CMS capabilities for a project but will still have to maintain the software updates and backups.

Pros and Cons of Writing Code From Scratch

Here are some benefits of writing code all by yourself from scratch:

  • Your website will only have the code it needs, which allows it to load faster.
  • You won’t need to maintain software updates.
  • You will get valuable programming skills that may lead to new WordPress career opportunities.

However, you have to compare these advantages with the following downsides:

  • You will spend hours and days learning to code in HTML, CSS, and JavaScript.
  • Generating content dynamically will be difficult, as you will not have access to a pre-built backend system. In addition, you’ll need to learn server-side languages like PHP or Python.
  • Adding and updating content will require editing multiple files.
  • Adding new functionality, SEO (search engine optimization), and integrations with third-party tools will be difficult.
  • You can’t easily share access to your website without giving full control to someone else.
  • If you hire a developer to write the code for you, then it will be expensive and not very cost-effective.

For more details, see our guide on website builders vs manual coding.

Since your time is valuable, we’ll show you how to create a website using tools that basically write the code for you (we’ll cover these in methods 1 and 2).

Then in method 3, we’ll share some resources on how to build a website completely from scratch. This is perfect if you’re a student who wants to learn programming.

With that said, let’s look at how to code a website. You can use the quick links below to jump to the method you want to use:

 Already feeling overwhelmed? Our team of experts can take your ideas and code a stunning website for you. Simply tell your dedicated project manager what you want, and our team will create multiple revisions until you’re happy with the final design. It really is the ultimate code-free and stress-free website design!

1. Code a Custom Website With WordPress

WordPress is the most popular website builder platform. In fact, according to our CMS market share report, WordPress powers over 43% of all websites on the internet.

We use WordPress for all our websites. Our in-depth WordPress review discusses its pros and cons in more detail.

Out-of-the-box, WordPress already comes with a ton of features, but it gets even better: you can install add-ons called plugins. These are pieces of software that add extra functionality to WordPress, and you can find over 59,000 in the WordPress.org repository alone, including many no-code page builders.

When it comes to page builders, SeedProd is our top choice. It’s a popular drag-and-drop WordPress page builder that we’ve used to design many of our partner websites. We even designed the SeedProd website using SeedProd!

SeedProd WordPress Website Builder

For more information, check out our detailed SeedProd review.

To start with WordPress, you will need a domain name and web hosting. We recommend using Bluehost. They are one of the top WordPress hosting providers, and they are offering our readers a free domain name and a huge discount on hosting (just $1.99/month).

If you want to look at alternatives, we recommend Hostinger, SiteGround, or one of the other best WordPress hosting companies.

After you have a domain and hosting, the next step is to install WordPress (the right way).

The great news is that most good web hosting companies like Bluehost, make installing WordPress super easy with their one-click installation process. It’s really user-friendly, so you can just follow the onscreen instructions to get started.

Once you have installed WordPress, you can log in to the admin dashboard. It will look something like this:

WordPress dashboard

Now, let’s talk about making your website look amazing without needing to write a single line of code. To start, you’ll need to install and activate the SeedProd plugin. For details, see our tutorial on installing a WordPress plugin.

SeedProd lets you easily design your own website and create beautiful pages simply by dragging and dropping – no coding required, so it’s perfect for this tutorial.

You can also use it to create your own custom WordPress theme from scratch. This will be the front end of your website that users will see when they visit it.

Going further, SeedProd even has an AI builder that creates an entire custom theme for you in less than 60 seconds. For details, see our guide on how to make a WordPress website with AI.

Once you have installed SeedProd, just go to the SeedProd » Landing Pages page and click the ‘Add New Landing Page’ button.

Create a new landing page in SeedProd

On the next screen, you will be asked to choose a template.

SeedProd comes loaded with tons of beautifully designed templates to give you a head start. This includes templates for specific use cases, such as non-profit websites or automotive business sites. Or, you can choose ‘Blank Template’ to start with an empty page.

Choose template

After that, you will be asked to enter a title for your page and a URL slug.

For instance, if you are creating your website’s front page, you can enter ‘Home’ as the title and URL (that’s the web address for that specific page).

Choose page title and URL

Then, you need to click on the ‘Save and Start Editing the Page’ button.

SeedProd will now load the page builder interface. It is an intuitive page builder where you can simply point and click to start editing.

Page builder UI

SeedProd’s drag-and-drop interface is a breeze for beginners, but it’s also powerful enough for experienced developers.

On the left side, you’ll see all the common web design elements as blocks. Think of these as building blocks you can simply drag onto your page.

To your right, you’ll see a live preview of your design. You can simply point and click on any element to edit, delete, or move it.

Struggling for inspiration, or simply want to build your website quickly? SeedProd comes with powerful AI features that can generate text, including headlines, captions, and calls to action, with ease.

Just add a Text block to your design and click on the ‘Generate AI Text’ button. Type in the prompt you want to use and hit ‘Generate Text.’ SeedProd will then generate some text based on your instructions.

SeedProd's powerful artificial intelligence (AI) features

Want to create unique images and graphics without having to use web design software such as Canva?

Then SeedProd integrates with DALL-E so you can generate original images in seconds and then add them to your site with a single click.

Generating images using AI

Basically, you can create a custom web design, including a navigation menu, sidebars, and footers, without writing code.

Now, if you do need to add some custom code, SeedProd has you covered there too. Just drag and drop the ‘Custom HTML’ block onto your page.

Custom HTML Block

Inside that block, you can manually add any HTML code you need.

You can also adjust the margin, padding, and design attributes of your custom HTML block.

Custom HTML block preview

Similarly, you can also add custom CSS code to your page.

Just click the ‘Settings’ button in the bottom left corner and choose ‘Custom CSS’.

Custom CSS

Once you finish editing your page, click the ‘Save and Publish’ button to make it go live.

You can also click the ‘Preview’ button to view your page in live action.

Save and preview page

Simply repeat the process to create other pages for your website. You can literally build a one-page website or even an entire small business website, in minutes.

The beauty of SeedProd is that it makes creating and editing a website incredibly easy.

That’s why so many professional developers around the world use it. In fact, even the developers at big companies like Awesome Motive rely on SeedProd to build their main websites because it’s so fast and customizable.

Alternatives to SeedProd

Don’t want to use SeedProd? We’ve got you covered! Here are some of our top picks for other WordPress page builders you can use:

  • Thrive Architect – This is a fantastic page builder that’s really focused on getting you conversions. It comes with over 357 pre-designed layouts to get you started quickly.
  • Divi Builder – Another powerful drag-and-drop builder that works as both a theme and a page builder. It gives you a ton of flexibility.
  • Beaver Builder – This is another well-known and reliable WordPress page builder that many people love.
  • Astra – If you’re looking for a theme, Astra is super customizable and comes with ready-made starter websites that you can install with just one click. It’s a real time-saver!

While we might be a little biased towards WordPress (since, well, we’re WPBeginner!) its popularity really speaks for itself. Tons of big names like BBC, Microsoft, Facebook, and The New York Times use WordPress. So you know you’re in good company!

Tip: Need help setting up WordPress? Our expert team can help you with a free WordPress blog setup.

2. Code a Website With Web.com Website Builder

Web.com website builder

If you’d rather skip the steps of getting a domain name, setting up hosting, and installing software like WordPress, then you might want to check out the Web.com website builder.

It is a great platform to build simple business websites and online stores. They even have a guided wizard that helps with the process.

Web.com’s pricing plans include a free domain name, free SSL certificate (which is important for security), dozens of templates, and an AI writing tool to help you generate website copy quickly.

Simply pick from their thousands of beautiful pre-made website templates and customize the design to match your brand needs with point and click.

Web.com templates

The builder comes with all the powerful features you would expect.

You can easily add photo galleries, videos, testimonial sliders, contact forms, map locations, social media buttons, and more.

Web.com edit website

You won’t need to worry about updates, security, or backups because Web.com handles that for you. They also offer 24/7 chat, email, and phone support.

Alternatives to Web.com

There are plenty of different all-in-one solutions out there. Apart from Web.com, here are some of our top picks for easy-to-use website builders that aren’t WordPress:

  • Gator by HostGator – Fully hosted website builder with drag-and-drop tools and templates.
  • Domain.com Website Builder – Another hosted option with tons of beautiful templates for all kinds of websites.
  • HubSpot – This is an all-in-one website builder and marketing platform that’s great for small businesses.
  • Wix – A well-known drag-and-drop website builder that’s pretty popular.
  • BigCommerce – If you’re specifically looking to build an online store, BigCommerce is a fully hosted option to consider.

For more options, you can see our comparison of the best website builders with pros and cons. We’ve put in the hard work, testing pretty much every major website builder out there. So, we like to think we know what we’re talking about when it comes to picking the right website builder!

3. Learn to Code a Website From Scratch

Are you a student, keen to learn how to code a website from scratch? That’s awesome! You’ll need to get your head around some website development basics like HTML, CSS, and a few other things.

While there are tons of courses out there (both free and paid), the one we think is really great is over at Code Academy.

It takes roughly 9 hours to complete, but by the end, you will have learned to code a custom responsive website from scratch using HTML, CSS, and Bootstrap.

Even after finishing the course, you’ll need to put in some practice to really get good at coding websites from scratch. But don’t worry, we’re here to help! In the next section, we’ll show you how to code a super basic website using just HTML and CSS.

Even after you finish the course, you will need hours of practice before you can truly become efficient at coding websites from scratch. In the next section, we will show you how to code a very basic website using HTML and CSS.

Coding a Basic Static Website

Websites are built using HTML, CSS, and sometimes some JavaScript. Think of them like this:

  • HTML (Hyper Text Markup Language): This is the foundation of your webpage. It defines the basic layout and all the content, like images, text, videos, and more.
  • CSS (Cascading Style Sheets): This is what makes your website look good! CSS handles things like colors, margins, padding, and text size.

To write this code, you will need a code editor. This is like a special text editor that helps you write code by highlighting different parts, which makes it easier to spot mistakes and write more efficiently.

Sublime text code editor

Next up, you need to start a project. Just create a new folder on your computer and name it whatever you like. This is where you’ll keep all your website files.

Open your code editor and create a new file. Since this will be your website’s home page, we recommend naming it index.html.

This file is where you will write the HTML code for your first web page.

A basic HTML page contains the following sections.

  • HTML document wrapper
  • Head
  • Body

You can create this basic structure by writing the following code:

<!DOCTYPE html>
<html>
    <head>

    </head>
    <body>

    </body>
</html>

The doctype HTML declaration just tells web browsers that it is an HTML page.

The code inside the head section isn’t visible on the screen. It defines metadata for your HTML document, like the title of your HTML document, link to the CSS file, and more.

Now, let’s fill in the head section of your HTML page:

<!DOCTYPE html>
<html>
    <head>
		<title>Star Plumbing Services</title>
		<link rel="stylesheet" href="style.css" /> 
    </head>
    <body>

    </body>
</html>

The body section of your website is where you define the page layout and add all the content that people will see.

Here is an example of a sample web page with a header, main content area, and footer:

<!DOCTYPE html>
<html>
    <head>
		<title>Star Plumbing Services</title>
		<link rel="stylesheet" href="style.css" /> 
    </head>
    <body>
		<header id="header" class="site-header"> 
		<h1 class="site-title">Star Plumbing Services</h1>
		<nav class="site-navigation">
		<ul class="nav-menu">
		<li><a href-"index.html">Home</a></li>
		<li><a href="about.html">About</a></li>
		<li><a href="contact.html">Contact</a></li> 
		</ul>
		</header> 
		
		<article id="main" class="content"> 
		
		<h2>The Best Plumbing Service Providers in Pawnee!</h2>
		
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
		
		<p><a href="contact.html" class="cta-button">Call Now</a></p>
		
		<p><img src="images/plumbing-services.jpg" alt="Star plumbing services at work" width="600px" /></p>
		
		<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
		
		</article> 
		
		<footer>
		<p>© 2023 Star Plumbing Services. All Rights Reserved - Call us +1-5555-5555</p>
		</footer> 

    </body>
</html>

Feel free to replace the placeholders with your own content. Just remember to save your changes!

After saving your HTML document, you can preview it in a browser. You might see something that looks a little plain at first, like this:

Plain HTML without CSS

That’s because our HTML document points to two files that don’t exist. The first one is the CSS stylesheet.

CSS or Cascading Style Sheet is another coding language. It is used to for styling HTML elements, building blocks, and div selectors in your HTML documents.

Simply create a file called style.css using your code editor and save it in the same folder as your index.html file.

After that, add the following code to your style.css file:

body {
	margin:0;
	padding:0;
	font-family:sans-serif; 
	font-size:16px;
	background-color:#f2ffee;
}

h1, h2, h3 { 
font-family:Georgia, Times, serif; 
} 

h2 { 
font-size:xx-large;
}

.site-header {
background-color:#2751ac;
width:100%;
padding:20px; 
overflow: auto;
color:#FFF;
	} 

	
.site-title { 
float:left; 
}

.site-navigation { 

float:right;
text-align:right;
margin:20px 50px 0px 0px;
} 

ul.nav-menu { 
list-style-type:none;
list-style:none;
}
ul.nav-menu li { 
display:inline;
padding-right:20px;
}


.site-header:after{ 
clear:both;
}

#main {

margin:0 auto; 
background-color:#FFF;
	} 

.content {
	
max-width:60%;
padding:30px;
margin:50px 0px 50px 0px;
font-size:18px;
}

.content p { 
margin:50px 20px 50px 20px; 

}

a.cta-button {
    background-color: green;
    padding: 20px 100px 20px 100px;
    color: #fff;
    text-decoration: none;
    font-size: xxx-large;
	border:2px solid #abfcab;
	border-radius:18px;
   
}

footer {
background-color:#2751ac;
width:100%;
padding:20px; 
overflow: auto;
color:#FFF;
	} 

This takes care of styling. But keep in mind, CSS can do so much more than what we’ve shown here! It can be used to really improve the user experience, add animations, and even adjust how your website looks on different screen sizes using something called media queries.

Next, we still need to upload an image.

Simply create a new folder in your project and name it images.

Create images folder

Now, find an image you want to display and add it to the images folder.

Then, go back to your index.html file and change the image name in the <img> tag to the actual name of your image file.

Don’t forget to save all your changes and then preview your page in the browser again. You should now see your image and the basic styling from your CSS file.

Basic HTML page preview

You can repeat this process to create other pages for your website. A handy trick is to use your index.html file as a template for your other pages. Just save it with a different name (like about.html or contact.html) and then change the content as needed.

We hope this article helped you learn how to code a website. If you opted for WordPress, then you may want to learn WordPress (for free) in less than a week or take a look at the best code editors for beginners.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

27 CommentsLeave a Reply

  1. Mrteesurez

    I completely agree with the point about learning the basics of web development. While no-code tools like WordPress have made it easier for anyone to build a website quickly, having a solid understanding of HTML, CSS, JavaScript, and PHP allows you to customize and tweak your site exactly how you want. I’ve found that knowing these fundamentals has been beneficial when I need to make specific adjustments that I didn’t find a plugin or tools that will give me that functionality. Great article, thanks for sharing this guide with full of insights!

  2. Ayanda Temitayo

    While no-code tools like WordPress and other CMS platforms have democratized website creation, I still advocate for learning the fundamentals of the web development languages as mentioned in this article: HTML, CSS, JavaScript, and PHP.

    Although writing code to develop a website takes a lot of time against using no-code tools like wordpress. But you can easily tweek the functionalities and customise it to your taste.

    Great insight in this article. Thanks

    • Dayo Olobayo

      I am a beginner in the world of web development but I can’t bring myself to agree with the second paragraph. My website is up and running without a prior idea of WordPress or code but I have it just the way I want. The more interesting thing is that there are plugins that helps with customization and styling. I would rather spend time on knowing how to use those plugins than going through such a hectic learning process of deep codes and the likes.

      • Jiří Vaněk

        Hello Dayo Olobayo,
        Regarding the second paragraph, I actually agree. Yes, it is possible to build a website in WordPress without coding knowledge, but if you then test such a website on PageSpeed for speed, or check the website for security vulnerabilities, you might find errors, weaknesses, or speed limitations. So yes, with WordPress, you don’t need to know code or how to program, but you can tell when a website was made by a programmer versus a beginner. Often, it’s in the details that aren’t visible to the naked eye.

  3. Peter Iriogbe

    Although WordPress and other CMS platforms have made it easier for many people with no coding experience to create an awesome website, I still recommend learning the basics of web development languages mentioned in this article: HTML, CSS, JavaScript, and PHP. Acquiring knowledge in these languages will enable users to manually customize their site or address issues without spending a dollar.
    Additionally, gaining proficiency in these languages opens up endless possibilities for creative and functional enhancements to your website.

  4. THANKGOD JONATHAN

    I never thought I could code a website, but this guide made it seem so easy. I’m excited to know that I can build my own site now! However, with Wordpress here I don’t think there is anything to worry about.

  5. Jiří Vaněk

    I’ve learned a lot about using artificial intelligence lately. For instance, it’s fantastic for WordPress snippets. I specify exactly what I need for WordPress to create an AI-generated snippet. It’s not always successful on the first try, but we get to the result. What’s great is that once the snippet works, I ask AI to explain how each element functions. It’s taught me a lot.

    • WPBeginner Support

      You need to be careful of AI hallucinating but that is certainly a way to learn more :)

      Admin

    • Moinuddin Waheed

      I have also utilised chatgpt for writing specific code snippets and coming from somewhat coding background it easily makes sense for me what works and what doesn’t.
      These tools have speed up the process of writing code for the better. we only need to make some tweak to suit our needs.

      • Jiří Vaněk

        But it is good to pay attention to the security of the plugin. Some codes can be written incorrectly by the AI. Therefore, just to be sure, I have a snippet written using chat GPT, and when I get to the point that it works, I usually have it checked with Bard from Google to tell me if there is any gap in the code. Pretty good practice to eliminate the problem.

  6. A Owadud Bhuiyan

    Thanks for sharing.

    Have you any articles regarding inspecting website?

  7. Ralph

    I remember learning HTML in school and was proud of first website that was basically plain text and color background. However after many years i came to conclusion it is just not for me and I prefer website builders. But knowing basics and having any idea how “to think” is really helpful when you want to customize something, that theme author didn’t think about.

    • Jiří Vaněk

      I started out with HTML, and my initial websites were in HTML. Then, in 2006, I began working at a data center as a second-level administrator and started learning WordPress, Joomla, phpBB, and Drupal. That led me to grasp the basics of PHP and CSS. Particularly, knowing CSS nowadays is truly beneficial because even though you can download a ready-made template or use Elementor, if you know CSS, you can fine-tune everything to your liking.

  8. Moinuddin Waheed

    writing code for making websites requires time and effort which at times people will be overwhelmed and left in the process. there are benefits of course in learning to code but it is not every one’s cup of tea.
    whereas using modern tools to create website is much more easier and cost effective although there are some downside to it as well.
    these plugins like seedprod have made the life of every developer easier and efficient.
    Thanks for making a holistic approach of pros and cons of each side.

    • WPBeginner Support

      You’re welcome!

      Admin

  9. Olaniyi Ifeoluwa

    Thanks for this helpful Article.
    Please concerning coding a website from scratch, do I still need to purchase domain and hosting.

    • WPBeginner Support

      You can create the site on your computer if you wanted for testing. To allow users to see your site, we would recommend using a hosting provider and a domain as those would be required then.

      Admin

    • Moinuddin Waheed

      Domain name and hosting services are required to showcase your website to the world.
      So no matter the website is coded manually or using the page builders which is behind the scene well optimised codes, requires hosting to host the website and show to the world.
      For learning and testing purposes you can always use your local IDEs and code your website.

  10. Muntaha

    I liked this one because all in it helps always….Thank you

    • WPBeginner Support

      Glad you found our guide helpful :)

      Admin

  11. Ehis

    This is great Thanks a million

    • WPBeginner Support

      You’re welcome :)

      Admin

  12. Esther

    This was very helpful!

    • WPBeginner Support

      Glad our article was helpful :)

      Admin

  13. Muhammad Atif

    Wow, Nice article. I am really proud of you for great tutorials, tips and hacks. Started Wpbegginer by a Pakistani Syed Balkhi.
    Feeling good.

    • WPBeginner Support

      Thank you, glad you like our content :)

      Admin

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.