# How to Display Sun &amp; Moon Times (Astronomical Data) in WordPress

BFCM Deals 202650%OffOn all Location Weather Pro plansEnds Soon[Grab the deal](https://locationweather.io/pricing/?utm_source=header_optin&utm_medium=lw_dealbutton&utm_campaign=bfcm26)

![Location Weather](https://locationweather.io/wp-content/uploads/2026/03/Logo-1-1.svg)

![weather icon](https://locationweather.io/wp-content/plugins/location-weather-pro/assets/images/icons/weather-icons/01n.svg)

28°

## HOT

[Account](https://account.shapedplugin.com/?ref=1) [Get It Now](https://locationweather.io/pricing/)

![Location Weather](https://locationweather.io/wp-content/uploads/2026/03/Logo-1-1.svg)

[Account](https://account.shapedplugin.com/?ref=1) [Get It Now](https://locationweather.io/pricing/)

![](https://locationweather.io/wp-content/uploads/2023/11/Location-Weather.svg)

Join **20000+** Happy Users Who Use **Location Weather** to Show Weather Forecasts

[Get It Now](https://locationweather.io/pricing/)

[Tips & Tricks](https://locationweather.io/category/tips-tricks/) [Tutorials](https://locationweather.io/category/tutorials/)

## How to Display Sun & Moon Times (Astronomical Data) in WordPress

![](https://secure.gravatar.com/avatar/b1a4babfd858c03c90d6eeef9bdee4ad2c42a656ffa656f9e713ac4e5d23c6c4?s=48&d=mm&r=g)

Rubel Miah

April 2, 2026

5–8 minutes

![How to Display Sun Moon Times Data in WordPress](https://locationweather.io/wp-content/uploads/2026/04/How-to-Display-Astronomical-Data-Sunrise-Set-Golden-Hour-and-Moon-Phases-in-WordPress.webp)

Want to display accurate sun and moon times on your WordPress business site — including sunrise and sunset, golden hour, solar noon, moonrise, moonset, and moon phases? It’s easier than you think.

Whether you run a tourism site, an event business, or a local service, showing daily sun and moon times can help users schedule outings and create memorable experiences. You can showcase [precise astronomical data](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/) (Sun & Moon times) by using a dedicated weather plugin like **[Location Weather](https://locationweather.io/pricing/?ref=335),** which has a dedicated [Sun & Moon times block](https://locationweather.io/blocks/#demoId50).

In this post, I’ll show you how to add and display daily sun and moon times on your WordPress site in just a few minutes.

**Let’s get started.**

## What are the Sun & Moon Times?

![](https://locationweather.io/wp-content/uploads/2026/04/Live-Example-of-Sun-Moon-Times-Block.png)

Although we know what sun & moon times are, let’s know further what they mean and are used for as business owners. It refers to [precise astronomical data](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/) or events that show how the sun and moon move throughout the day and night relative to a specific location on Earth. 

Most importantly, these data are useful for scientists to collect research data, including key sun & moon events, and forecasts, photographers for capturing perfect lighting, travelers for planning trips, and businesses to help customers schedule activities more effectively.

### Benefits of Displaying Sun & Moon Times on Your Business Website

Showing accurate real-time sun and moon times on any [weather-dependent business](https://locationweather.io/businesses-and-organizations-need-weather-forecasts/) isn’t just an informative feature — it’s a valuable & practical tool that helps customers plan smarter, while boosting engagement, trust, and conversions.

- **Help Visitors Plan Smarter** – Sunrise, sunset, and moon phase data enable users to schedule tours, events, and outdoor activities with confidence.
- **Perfect for Tourism & Outdoor Businesses** – The best times for sightseeing, beach trips, and night experiences are clearly highlighted to attract more customers.
- **Attract Photographers & Content Creators** – Golden hour and moon phases help photographers and creators plan perfectly timed shoots.
- **Enable Advanced Planning with Forecasts** – A 16-day sun and moon forecast allows visitors to plan weddings, tours, and outdoor events.
- **Increase Engagement & Repeat Visits** – Daily-updated astronomical data keeps planners, travelers, and enthusiasts returning regularly.
- **Build Trust with Accurate, Scientific Data** – Location-based, astronomically calculated data strengthens your site’s reliability and authority.

## How to Display Sun & Moon Times in WordPress (4 Simple Steps)

To display Sun & Moon times, first and foremost, you need a weather plugin that gives this flexibility to show such real-time [astronomical data](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/) as [Location Weather](https://locationweather.io/pricing/?ref=335). Simply follow the steps below to add and make it live in just a few minutes.

### Step 1: Get Location Weather

![Best Weather & Air Quality Plugin for WordPress](https://locationweather.io/wp-content/uploads/2026/03/What-is-the-Location-Weather-Plugin.webp)

[Location Weather](https://locationweather.io/) is the leading Weather and Air Quality plugin for WordPress, with the highest number of active installations, reviews, and ratings in its category. As the #1 Weather plugin around the world, it has been featured on popular platforms such as WPBeginner, WP Engine, WPMU DEV, Elegant Themes, and HubSpot. Over 20,000 business owners love Location Weather for its powerful features, easy customization, and responsive support.

Now, with the **[Sun & Moon Times Block](https://locationweather.io/blocks/#demoId50)**, you can display real-time astronomical data alongside weather information — helping visitors plan outdoor activities, events, photography shoots, or travel with precision.

**Key Features:**

- 60+ ready-to-use [weather patterns library](https://locationweather.io/patterns/)
- 17+ visual drag-and-drop [weather blocks](https://locationweather.io/blocks/) for flexible display
- **[Sun & Moon Times block](https://locationweather.io/blocks/#demoId50)** to display sunrise/set, golden hour, moon phases, etc.
- Display key sun & moon events and up to 16-day forecasts
- [Daily/hourly weather forecasts](https://locationweather.io/add-accurate-in-depth-weather-forecasts/) in a [sleek pop-up or card](https://locationweather.io/display-weather-details-on-a-sleek-popup/)
- [AQI data](https://locationweather.io/display-air-quality-details-for-safe-comfortable-planning/), [historical weather insights](https://locationweather.io/display-reliable-weather-history-for-46-years/), [astronomy information](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/), [interactive weather maps](https://locationweather.io/visualize-weather-conditions-with-interactive-maps/), and more
- Location-based weather data with easy unit switching
- Display weather by fixed location, [visitor’s location](https://locationweather.io/display-weather-for-visitors-location-by-auto-detection/), or [custom weather search](https://locationweather.io/let-visitors-search-the-weather-for-any-location-worldwide/)
- Dynamic backgrounds that change based on live weather conditions
- Full design control with animations, images, videos, or custom color backgrounds

So, don’t wait. Let’s install [Location Weather](https://locationweather.io/pricing/?ref=335), [activate](https://locationweather.io/docs/download-location-weather-plugin/), and add the [Sun & Moon Times Block](https://locationweather.io/blocks/#demoId50) from the ready pattern library, add your API key, choose a template, customize, and publish [real-time weather and astronomical data](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/) — no coding required. 

### Step 2: Configure Weather API Key

To fetch accurate astronomical data, we first need to configure a Weather API Key from OpenWeather or WeatherAPI. Follow the steps below to get a free or paid weather API key and set it up in Location Weather.

![How to Get & Activate Weather API Key from OpenWeather or Weather API](https://locationweather.io/wp-content/uploads/2026/04/How-to-Get-Activate-Weather-API-Key-from-OpenWeather-or-Weather-API-1024x664.webp)

1. In your WordPress admin sidebar, click **Location Weather**.
2. Open the **Settings** panel of Location Weather.
3. Navigate to the **Weather API Key** section.
4. Click **Get your API key** to visit the **[OpenWeather](https://home.openweathermap.org/users/sign_up)**signup page.

- Create an account with your email.
- Generate the API key, copy it, and paste it into the **OpenWeather API Key** field.

5. Alternatively, you can add an API key from **WeatherAPI** using the same process.

6. Click **Save Changes** to activate your API key.

You can also check out the [full guidelines about the Weather API key plans and setup](https://locationweather.io/api-integration-guidelines/) here.

### Step 3: Create Beautiful Sun & Moon Times Template

Now it’s time to create your [Sun & Moon Times widget to show astronomical data](https://locationweather.io/display-sunrise-sunset-and-moon-phase-data/). With 2 pre-designed templates, this ready-to-use [Sun & Moon Times block](https://locationweather.io/blocks/#demoId50)allows you to showcase sun, moon times, or both, including key events such as sunrise, sunset, golden hour, moonrise, and moon phases with a phases timeline card. 

Moreover, you can add up to 16 days of sun and moon forecasts in an organized, easy-to-read format, providing detailed insights for photographers, outdoor planners, and astronomy enthusiasts to track key astronomical events directly on your website.

Simply follow the easy steps below or check this [guide](https://locationweather.io/docs/sun-moon-times/)to create a beautiful sun & moon times showcase & display in minutes.

![How to choose Ready Sun & Moon Pattern from Weather Patterns Library](https://locationweather.io/wp-content/uploads/2026/04/How-to-choose-Ready-Sun-Moon-Pattern-from-Weather-Patterns-Library.webp)

1. Open the page or post, then click the **(+) Add Block** button or choose the **Rich Patterns Library**. Note: It’s easier to go with the pattern library. Just keep following me.
2. Search for or find **Sun & Moon Times** patterns.
3. Click to **Import**.

![How to Add SunRise, Sunset, Solar Moon & Golden Hour Times in WordPress Website](https://locationweather.io/wp-content/uploads/2026/04/How-to-Add-SunRise-Sunset-Solar-Moon-Golden-Hour-Times-in-WordPress-Website.webp)

4. Find a beautiful, premade template that will be inserted on your page or post.

5. Find the dedicated panels, including sun & moon tracker, key events, and forecasts, to customize them as you wish.

### Step 4: Customize and Publish Your Sun & Moon Times Widget

- **Choose Template & Set Location:** After inserting the sun & moon times ready templates, choose your desired one from 2 stylish layouts, set the location, and enable custom weather search.

![How to Choose & Design SunRise, Sunset, Solar Moon & Golden Hour Times Templates in WordPress Website](https://locationweather.io/wp-content/uploads/2026/04/How-to-Choose-Sun-Moon-Times-Templates-.png)

- **Sun & Moon Tracker** – Show/hide sun & moon times tracker, set heading label, show schedule cards (sunrise, sunset, moonrise, moonset), and display phase title card.
- **Phase Timeline** – Display a visual timeline of sun & moon phases.

![](https://locationweather.io/wp-content/uploads/2026/04/How-to-Show-or-Hide-Sun-Moon-Tracker-Schedule-Phase-Card-1.png)

![](https://locationweather.io/wp-content/uploads/2026/04/How-to-Show-or-Hide-Sun-and-Moon-Phases-Timeline.png)

- **Key Events** – Select which events to show: sunrise, sunset, golden hour, solar noon, moonrise, moonset, and moon phases.

![](https://locationweather.io/wp-content/uploads/2026/04/How-to-Show-or-Hide-Key-Sun-Moon-Events-1.png)

- **Forecasts** – Show the 16-day sun and moon forecast for advanced planning.

![](https://locationweather.io/wp-content/uploads/2026/04/How-to-Show-or-Hide-Key-Sun-Moon-Forecasts-1.png)

- **Global & Custom Stylings**– Customize templates, colors, backgrounds, borders, typography, icons, spacing, and layout for a visually appealing display.
- Once finished, click **Publish** or **Update**.

That’s it — your sun & moon times will now be visible on your site! Let’s watch a [live demo](https://locationweather.io/blocks/#demoId50) of how the Sun & Moon Times will be displayed on your WordPress website.

### Best 5 Tips to Display Sun & Moon Times on Your WordPress Business

- **Integrate with key pages** – Combine sun & moon times with event, tour, or activity pages (e.g., “Best Sunset Views in Spring”).
- **Highlight golden hour** – Perfect for photography workshops, wedding planning, or outdoor sessions.
- **Use clear visuals** – Icons, colors, and structured layouts make the information easy to scan.
- **Strategic placement** – Add the block to high-traffic areas like your homepage, sidebar, or local guides.
- **Enable custom location search** – For a global audience, let visitors select their city to see accurate times.

## **Final Thoughts**

Adding sun and moon times with accurate, location-based sunrise, sunset, and moon phases is not just an extra feature; it’s a smart business tool that helps you stay ahead of the competition.

So why wait? Download [Location Weather](https://locationweather.io/pricing/?ref=335) today and turn astronomical insights into real business value, helping your visitors plan smarter, engage more, and return again and again.

Get Location Weather

Live Sun & Moon Times Display

---

![Rubel Miah](https://secure.gravatar.com/avatar/b1a4babfd858c03c90d6eeef9bdee4ad2c42a656ffa656f9e713ac4e5d23c6c4?s=96&d=mm&r=g)

Rubel Miah

## Share this blog

## If you like this blog share it with your friends.

## Comments

### Leave a Reply [Cancel reply](https://locationweather.io/display-sun-moon-times-in-wordpress/#respond)

![](https://locationweather.io/wp-content/uploads/2026/04/newsletter_6548097-1.svg)

## Join the Growing

## ShapedPlugin Family

## No spam – updates, tips & tricks to help.

![](https://locationweather.io/wp-content/uploads/2026/04/Facebook-Location-Weather.webp)

## Add Reliable Weather and Air Quality Insights to Guide Customer Buying and Travel Decisions.

## Increase sales of weather-dependent goods and services by helping customers use weather data in their buying or travel decisions.

[Get Location Weather Now](https://locationweather.io/pricing/)

14-Day No-Question-Asked [Refund Policy](https://shapedplugin.com/refund-policy/)

![](https://locationweather.io/wp-content/uploads/2026/03/Logo-1-1-1.svg)

## 4.9

![](https://locationweather.io/wp-content/uploads/2026/03/Frame-63-2-2.svg)

## [on](https://www.trustpilot.com/review/shapedplugin.com?stars=5)

![](https://locationweather.io/wp-content/uploads/2026/03/Source-Logo.svg)

## **Location Weather**™ is the most powerful and easy-to-use weather forecast plugin for WordPress that allows you to create and display accurate weather forecasts.

## **Address**

## **ShapedPlugin **is a limited liability company (LLC). The address of the company’s registered office is 1207 Delaware Avenue #778, Wilmington, DE 19806, USA.

## **Subscribe our newsletter**

## No spam—just updates, tips & tricks to help you win.

## THE COMPANY

## FOLLOW US ON

## Our Products

## resources

## © 2019-2026 Location Weather. Made with ❤️ by**ShapedPlugin, LLC**

![](https://locationweather.io/wp-content/uploads/2026/03/Secure-Payment-Container-1.svg)

---

Source: https://locationweather.io/display-sun-moon-times-in-wordpress/
