# Attribute “st_url” not allowed on element “span” at this point.

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-st-url-not-allowed-on-element-span-at-this-point
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

HTML has a defined set of global attributes (like `class`, `id`, `title`, `lang`, etc.) and element-specific attributes that are permitted by the specification. Any attribute that falls outside this set — such as `st_url`, `st_title`, or `displayText` — will trigger a validation error because the browser and the validator don't recognize it as part of the HTML standard.

The `st_url` attribute, along with related attributes like `st_title`, `st_via`, and `displayText`, originated from early versions of the ShareThis social sharing library. These were proprietary attributes that the ShareThis JavaScript would read from the DOM to configure sharing behavior. While browsers generally ignore attributes they don't understand (so the page may still appear to work), using non-standard attributes violates the HTML specification and can cause several problems:

- **Standards compliance**: Invalid HTML can lead to unpredictable behavior across different browsers and future browser versions.
- **Accessibility**: Screen readers and other assistive technologies may not handle non-standard attributes correctly, potentially causing confusion.
- **Maintainability**: Non-standard markup is harder for other developers to understand and maintain.
- **SEO**: Search engine crawlers may penalize or misinterpret pages with significant validation errors.

HTML5 introduced `data-*` attributes specifically to solve this problem. Any custom data you need to attach to an element can use this pattern — for example, `data-st-url` instead of `st_url`. The ShareThis library itself updated its integration to use `data-*` attributes in later versions, so modern implementations should already follow this pattern.

## How to Fix

1. **Replace proprietary attributes with `data-*` equivalents**: Convert `st_url` to `data-st-url`, `st_title` to `data-st-title`, `displayText` to `data-display-text`, and so on.
2. **Update your ShareThis integration**: If you're using an outdated version of ShareThis (or an outdated CMS module/plugin like an old Drupal integration), update to the latest version, which uses valid HTML5 attributes.
3. **Check your CMS templates**: If the invalid attributes are hardcoded in a theme template or a content block, update them manually.

## Examples

### Invalid: Proprietary attributes on a `<span>`

```html
<span class="st_facebook_large" displayText="Facebook" st_url="https://example.com" st_title="My Page Title"></span>
<span class="st_twitter_large" displayText="Twitter" st_url="https://example.com" st_title="My Page Title"></span>
```

This markup uses `st_url`, `st_title`, and `displayText`, none of which are valid HTML attributes.

### Valid: Using `data-*` attributes instead

```html
<span class="st_facebook_large" data-display-text="Facebook" data-st-url="https://example.com" data-st-title="My Page Title"></span>
<span class="st_twitter_large" data-display-text="Twitter" data-st-url="https://example.com" data-st-title="My Page Title"></span>
```

By prefixing each custom attribute with `data-`, the markup becomes valid HTML5. Note that you may also need to update the associated JavaScript to read from these new attribute names (e.g., using `element.dataset.stUrl` instead of `element.getAttribute('st_url')`).

### Valid: Modern ShareThis integration

If you're updating your ShareThis integration entirely, the modern approach uses a different markup pattern:

```html
<div class="sharethis-inline-share-buttons" data-url="https://example.com" data-title="My Page Title"></div>
```

Modern versions of the ShareThis library expect `data-*` attributes by default, so upgrading the library and its associated markup is the cleanest solution. Check the [ShareThis documentation](https://sharethis.com) for the latest recommended integration approach for your platform.
