Mortgage Rates

By Mortgage Calculator

★ 4.0/5 (2 ratings)300+ active installationsVersion 1.4.1

Show current US mortgage rates on your site: weekly 30-year fixed, 15-year fixed and 5/1 ARM averages. Block, widget and shortcode.

Description

Mortgage Rates adds a compact box of current US mortgage rates to your WordPress site. It lists the average 30-year fixed, 15-year fixed and 5/1 ARM rates with the change since the previous week, and a “View Trend” link to the full rates page. It is meant for mortgage officers, real-estate agents and finance or home-buying blogs that want fresh rate content for their readers without updating it by hand. Add it as a Gutenberg block, a sidebar widget or the [mlrates] shortcode.

The widget shows the weekly U.S. average rates (Freddie Mac Primary Mortgage Market Survey) published by mlcalc.com. Your site fetches them as data and caches them; all of the widget’s code ships with the plugin.

Features

  • Current average 30-year fixed, 15-year fixed and 5/1 ARM mortgage rates
  • Weekly change shown next to each rate
  • Updates automatically: your server refreshes the data at most every six hours and keeps the last good copy if the source is unreachable
  • Gutenberg block “Mortgage Rates” with a live preview, sidebar widget, [mlrates] shortcode or a template function
  • Wide (300px) or narrow form
  • “View Trend” link that opens the full mortgage rates page on mlcalc.com in a new tab
  • No API key or account needed

How to use

In the block editor, click the “+” button, search for “Mortgage Rates” and add the block; the sidebar lets you set the state label and the size.

Or add the shortcode to a page or post:

[mlrates]

Set the form size or the state label:

[mlrates state="NY" size="narrow"]

You can also add the “Mortgage Rates” widget under Appearance > Widgets, or call <?php display_mlcalc_rates(); ?> from a theme template.

Shortcode parameters

  • size = wide | narrow
  • state = a US state code, for example NY. It sets the name shown in the widget heading and the state rates page the heading links to. The rate values shown are the U.S. averages.

Who it is for

Mortgage officers, real-estate agents, home-buying and personal-finance blogs.

Please note

The rates are national averages for information only. They are not your lender’s rates and not an offer.

External services

This plugin gets the current mortgage rates from mlcalc.com (operated by ARSIDIAN LLC). Your WordPress server requests https://www.mlcalc.com/mortgage-rates/rates.json when the widget is shown and the cached copy is older than six hours (or an hour after a failed request). The request is made by your server, not by visitors’ browsers, and sends no data about your site’s visitors; mlcalc.com sees only your server’s IP address and the standard request headers WordPress sends. The response contains only the rates and their date, which are stored in your database so the widget keeps working if mlcalc.com cannot be reached.

When a visitor clicks “View Trend”, the mlcalc.com mortgage rates page (https://www.mlcalc.com/mortgage-rates/) opens in a new tab; nothing is sent unless the visitor clicks.

  • Service: https://www.mlcalc.com/mortgage-rates/
  • Terms of use: https://www.mlcalc.com/terms.htm
  • Privacy policy: https://www.mlcalc.com/privacy.htm

Mortgage Rates Screenshots

  1. The Mortgage Rates front-end, as it appears in your WordPress Sidebar.
  2. The Trend Chart and Detailed Rates, as it appears when a visitor clicks the View Trend anchor.
  3. The Mortgage Rates widget configuration dialog, as it appears within WordPress Administration Interface.

Installation

  1. Upload the mortgage-rates directory (including all files within) to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

The Mortgage Rates plugin can be used in one of two ways: if you are using widgets, just add the plugin to the sidebar through the Appearance -> Widgets menu in WordPress. If you aren’t using widgets, add the following code: <?php display_mlcalc_rates(); ?> to your template where you would like the rates box to appear.

Usage

  • If you are using widgets, just add the Mortgage Rates plugin to the sidebar through the Appearance -> Widgets menu in WordPress.
  • Add the following code: <?php display_mlcalc_rates(); ?> to your template where you would like the calculator form to appear.
  • Add the shortcode [mlrates] to your page or post and configure default parameters.

Shortcode parameters

  • size = wide | narrow
  • state = any US state here

Shortcode examples

[mlrates]
[mlrates state="NY" size="narrow"]

FAQ

How do I add the rates to a page?

In the block editor add the “Mortgage Rates” block. In the classic editor or a Shortcode block use [mlrates] (or [mlrates state="NY" size="narrow"]). In a sidebar use the “Mortgage Rates” widget.

Where do the rates come from?

The weekly U.S. average rates (Freddie Mac Primary Mortgage Market Survey) as published by mlcalc.com. Your WordPress server downloads them from https://www.mlcalc.com/mortgage-rates/rates.json and stores them in your database.

How often are they updated?

The source is updated weekly. Your site checks for new data when the widget is shown and its cached copy is older than six hours (or an hour after a failed request).

Are these my lender’s rates?

No. They are national average rates from a weekly survey. They are for general information and are not an offer or a quote.

Can I show rates for a single state?

Not as separate numbers: the values are always the U.S. averages. The state attribute only changes the state name in the heading and the state rates page the heading links to on mlcalc.com.

Can I put it in a sidebar and in a post?

Yes. Use the widget in a sidebar or widget area and the [mlrates] shortcode in posts and pages.

Does the plugin send my visitors’ data anywhere?

No. Rates are fetched by your server, not by visitors’ browsers, and no data about visitors is sent. See the External services section for details.

May I use your widget on my commercial website

Yes. Absolutely.

Screenshots

Changelog

1.4.1

  • Fix: the block editor preview showed “loading…” instead of the rates.

1.4.0

  • Gutenberg block “Mortgage Rates” (state label and size, live preview).
  • Translation-ready: the widget labels, admin texts and block texts can be translated on translate.wordpress.org.
  • A review reminder in the admin after two weeks, dismissible.

1.3.15

  • Security: widget settings are saved only on requests whose nonce WordPress has verified (closes a CSRF on the classic widgets screen).
  • Rates from mlcalc.com are checked for plausible, finite values and the response size is limited.

1.3.14

  • Removed the unused jquery.pngFix.js file.

1.3.13

  • Security: escape all output (widget title, state name, URLs and the form templates).
  • Security: saving the widget settings now requires the edit_theme_options capability (core verifies the widgets nonce), and whitelists the state and form size.
  • Shortcode attributes are sanitized instead of being extracted into variables.
  • No remote code: the widget script ships with the plugin and loads in the footer; the rates are fetched by your server from mlcalc.com as data (rates.json), cached for six hours, with the last good copy kept for outages. “View Trend” opens the rates page in a new tab.
  • Deleting the plugin removes its settings and cached rates.
  • Documented the external service in readme.txt.