Fetches a published Google Form using a WordPress custom post or shortcode, removes the Gooogle wrapper HTML and then renders it as an HTML form embedded in your blog post or page. When using Google Form post type, the wpgform shortcode accepts one parameter, id, which is the post id of the form. When using the deprecated gform shortcode, the only required parameter is form
which is set to the URL to the Google Form URL. Recommended but optional, you can also provide a custom URL for a confirmation page if you don’t care for the default Google text. The confirmation page will override the default Google Thank You
page and offers better integration with your WordPress site. There are a number of other options, refer to the documentation for further details.
For example, suppose you want to integrate the form at https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0
, (not a real URL) use the following shortcode in your WordPress post or page:
[wpgform id='861']
[gform form='https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0']
Deprecated: use of the gform shortcode is deprecated – please use the wpgform shortcode.
Currently, this plugin only supports Google Forms that are “Published as a web page” and therefore public. Private Google Forms are not supported.
Demo
As features have been added, usage of the gform
shortcode has grown increasing complex (the gform
shortcode is now deprecated). Begining with v0.46, a second shortcode, wpgform
has been introduced in conjunction with a Custom Post Type to define forms deprecating usage of the gform
shortcode. Usage of the new shortcode and Custom Post Type is much, much easier than the complexities of the original gform
shortcode. Users are strong encouraged to migrate usage to the new shortcode and Custom Post Type. New features will only be added to the Custom Post Type usage model.
The WordPress Google Form shortcode wpgform
supports a single attribute. The rest of the controls are derived from the information stored with the Custom Post Type.
[wpgform id='' uid='']
NOTE: In the above syntax, values enclosed in angle brackets <>, indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
The Google Form deprecated shortcode gform
supports a number of attributes that allow further control and customization of the Google Form.
[gform form='' confirm='' class='' legal='on|off' br='on|off' prefix='' suffix='' email='on|off' sendto='' style='redirect|ajax' spreadsheet='' unitethemehack='on|off']
NOTE: In the above syntax, values enclosed in angle brackets <>, indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
legal='off'
to your shortcode usage. The content remains in the form, it is simply hidden from the end user using CSS.title='off'
to your shortcode usage. The maph1h2='on'
to your shortcode usage. The unitethemehack='on'
, when using the Unite theme from Paralleus. The Unite theme manipulates the submit button(s) on a page, the result of which is a button that prevents the Google form from being submitted. Turning this attribute on enables a hack which inserts class=”noStyle” to all submit buttons, preventing Unite from mucking with them.validation='on'
, to add jQuery based form validation support using the jQuery Validate Plugin. Enabling this optional attribute will allow inline checking without form submission to Google (which also does checking for required fields). Error messages can be styled using the gform-error CSS class.captcha='on'
, to add a simple math based CAPTCHA to the Google Form. The CAPTCHA only appears for the final submit on multi-page forms. The CAPTCHA error message can be styled using the gform-error CSS class.columns: The number of columns the form should be split into. By default the form appears in a single column the same way it is designed in Google Docs.
[gform form=’https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0′ confirm=’http://www.example.com/thankyou/’ style=’ajax’ class=’mygform’ legal=’off’ prefix=’mygform-‘ br=’on’ title=’on’ maph1h2=’on’ email=’on’ spreadsheet=’https://docs.google.com/spreadsheet/ccc?key=0AgBHWDGsX0PUdE56R1ZldXo4a0N3VTNMNEpSemdGV3c’ unitethemehack=’off’ validation=’on’ captcha=’on’ columns=’1′]
This plugin is available under the GPL license, which means that it’s free. If you use it for a commercial web site, if you appreciate my efforts or if you want to encourage me to develop and maintain it, please consider making a donation using Paypal, a secured payment solution. You just need to click the donate button on the the plugin overview page and follow the instructions.
Google Forms make use of 20+ CSS class definitions. By default, the WordPress Google Form plugin includes CSS declarations for all of the classes however the bulk of them are empty. The default CSS sets the font and makes the entry boxes wider. The default CSS that ships with WordPress Google Form can optionally be turned off via the WordPress Google Form settings.
There are two ways to customize the Google Form CSS.
As of 2013-12-04, the following is are the CSS classes which Google Forms make use of. The CSS below represents the default CSS provided by WordPress Google Form. These CSS definitions can be copied and pasted into your theme CSS or the WordPress Google Form custom CSS setting and changed as desired. Some of the classes are redundant to account for both the new and old style of Google Forms.
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* CSS declarations for Google Docs Forms
*
* These can be copied and modified to fit the needs of
* a theme. By default the only change is to make all of
* the fields wider than their default width and to set the
* default font.
*/
label.gform-error,
label.wpgform-error {
float: right;
color: red;
font-weight: bold;
}
div.gform-captcha,
div.wpgform-captcha {
margin: 5px 0px 10px;
display: none;
}
div.gform-browser-warning,
div.gform-browser-error,
div.wpgform-browser-warning,
div.wpgform-browser-error {
-webkit-border-radius: 3px;
border-radius: 3px;
border-width: 1px;
border-style: solid;
padding: 0 .6em;
margin: 5px 0 15px;
}
div.gform-browser-warning,
div.wpgform-browser-warning {
background-color: #ffffe0;
border-color: #e6db55;
}
div.gform-google-error,
div.gform-browser-error,
div.wpgform-google-error,
div.wpgform-browser-error {
background-color: #ffebe8;
border-color: #cc0000;
}
body.ss-base-body {}
div.errorbox-good {}
div.ss-attribution {}
div.ss-footer {}
div.ss-footer-txt, div.ss-logo {
display: none;
}
div.ss-form {}
div.ss-form-container {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
div.ss-form-desc {}
div.ss-form-entry {}
div.ss-form-entry>input {
background-color: #e0e0e0;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
div.ss-form-heading {}
div.ss-item {}
div.ss-legal {}
div.ss-navigate {}
div.ss-no-ignore-whitespace {
white-space: pre-wrap;
}
div.ss-required-asterisk {
color: red;
font-weight: bold;
}
div.ss-scale {}
div.ss-text {}
form#ss-form {}
h1.ss-form-title {}
hr.ss-email-break {}
input.ss-q-short:text {
width: 300px;
}
label.ss-q-help {
display: block;
}
label.ss-q-radio {}
label.ss-q-title {
font-weight: bold;
}
span.ss-powered-by {}
span.ss-terms {}
td.ss-gridnumber {}
td.ss-gridnumbers {}
td.ss-gridrow
td.ss-gridrow-leftlabel
td.ss-leftlabel {}
td.ss-rightlabel {}
td.ss-scalerow {}
td.ss-scalenumber {}
td.ss-scalenumbers {}
textarea.ss-q-long {
background-color: #e0e0e0;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
tr.ss-gridrow {}
/**
* New Google Forms CSS 2013-04-30
*/
div.ss-form-container div.disclaimer {
display: none;
}
div.ss-q-help {
}
div.ss-secondary-text {
}
/* This hides the "Never submit passwords through Google Forms." warning. */
td.ss-form-entry > div.ss-secondary-text {
display: none;
}
div.password-warning {
display: none;
}
div.ss-form-container li {
list-style-type: none;
}
/* 2013-06-04: Hide "Edit this Form" link */
a.ss-edit-link {
display: none;
}
/* 2013-06-06: Hide help text for scales */
div.aria-only-help {
display: none;
}
/* 2013-10-30: Hide default error messages */
div.error-message {
display: none;
}
/* 2013-10-30: Attempt to make text entry boxes a reasonable width */
input.ss-q-short, textarea.ss-q-long {
width: auto;
}
/* 2013-11-15: CSS to support using WordPress Google form to render spreadsheets */
/** Hide the gunk that Google adds to make the table work **/
td.hd, td.headerEnd, tr.rShim, td.sortBar {
display: none;
width: 0px !important;
padding: 0px !important;
}
/** Empty selector but could be used to select all of the table cells **/
tr.rShim td, tr.rShim ~ tr td {
}
/** Hide the "powered" and "listview" DIVs that Google adds **/
div div span.powered, div.listview {
display: none;
}
/** Hide the "This is a required question" message **/
div.ss-form-container div.required-message {
display: none;
}
1792 websites
wpgform
Free Plugin