Help:Diff - Wikipedia
Jump to content
From Wikipedia, the free encyclopedia
Wikipedia help page for diff feature
For the Wikimedia blog, see
diff
.wikimedia
.org
This page documents the full usage of diffs. For a simpler guide to the basics, see
Wikipedia:Simple diff and link guide
This help page is a
how-to guide
It explains concepts or processes used by the Wikipedia community. It is not one of
Wikipedia's policies or guidelines
, and may reflect varying levels of
consensus
Shortcuts
H:DIFF
H:DIFF
WP:DIFF
WP:DIFF
Are you new here? There is a simplified version of this page at
Wikipedia:Simplest diff guide
diff
(from the word "
diff
erence") is a web page displaying the difference between one version and another of a Wikipedia page. A particular version of a page is called a "revision"; each revision has a date and time of creation which can be seen in the
page history
. Clicking a "diff" link in a page's history will display the diff of two successive revisions.
Links to diffs are found on various special pages other than page histories, including the
User contributions
page which every user has,
Recent changes
Related changes
, and
watchlists
Using the history of a page, it is possible to generate a diff between
any
two versions – select the left
radio button
for the older version, the right radio button for the newer version, and click
Compare selected revisions
While editing a page, the
Show changes
button displays the changes you are about to make. The diff is also shown during an
edit conflict
Edit summary
(Briefly describe your changes)
This is a
minor edit
Watch this page
By publishing changes, you agree to the
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Publish changes
Show preview
Show changes
Cancel
How it looks
This example shows the top of the diff page (some of the links are dummies). The older version is shown on the left, the newer version on the right.
Revision as of 22:32, 3 August 2003
edit
Tim Starling
talk
contribs
Edit summaries
in diffs are great)
← Previous edit
Revision as of 00:10, 18 August 2003
edit
) (
undo
) (
thank
Angela
talk
contribs
rollback
(correction, +
MediaWiki User's Guide
Line 8:
Line 8:
For sysops and those with the rollback flag, a [[en:Wikipedia:revert|rollback]] button is shown allowing them to revert from the new version to the old one.
For sysops and those with the rollback flag, a [[en:Wikipedia:revert|rollback]] button is shown allowing them to revert from the new version to the old one.
This is only shown when viewing the diff between the
current
version and the one
immediately preceding it
This is only shown when viewing the diff between the
recent
version
of a page
and
the last version by an author other than
the one
of the most current version
This example shows the top of the diff page, with the links described above.
This example shows the top of the diff page, with the links described above.
Line 25:
Line 25:
[[MediaWiki User's Guide]]
Explanation of colours
Unchanged text is dark grey on light grey (only parts before and after changed text are shown). Paragraphs which have changed are black on white, with an orange border on the old version side and a blue border on the new version side. Inserted and removed text is highlighted with the border color and bolded. Where whole paragraphs have been removed or inserted, no highlighting or bolding is applied and the other side is blank.
Moved lines of wikitext are marked with curved arrows. Clicking on ↪ and ↩ scrolls the view to the corresponding line on the opposite side of the diff.
Colour key
Old version
New version
unchanged
unchanged
paragraph changed
paragraph changed
paragraph moved
paragraph removed
paragraph added
paragraph moved
removed text
added text
Controls and links
The links "Revision as of
date
" link to each version. If the newer version is the latest one, the link will be to the usual page and the wording will be "Current revision (
date
)" instead.
The "(edit)" link will take you to the page for editing that version. You may be warned that you are editing an out-of-date revision; if you ignore this and continue, you will revert all the edits made since after that revision.
The "(undo)" link on the newer revision's side will
revert
that specific edit. When you click the link, you can check the diff page of the edit you are going to make, and the
edit summary
will be automatically filled in with the phrase of
MediaWiki:undo-summary
(Undid revision
$1
by
$2
talk
)). This summary can be edited before you submit your edit. When you are undoing several edits at once, the auto-summary may not work. Though the link exists on all diff pages, it does not function when the revisions conflict. Often, versions older than the current one cannot be undone in this way. If it does not work, you will be told that the edit could not be undone and end up in the regular editing page of the current version.
The "(thank)" link is only displayed when both the viewer and editor are registered users. It can be used to
thank
the editor.
Below that are links to the user page and talk page of each user who edited the older or the newer versions. Links to the users' contribution lists are also shown. For administrators and
rollbackers
, a "[rollback]" button also appears where applicable, allowing them to revert all the edits made by that user.
Then the
edit summaries
are shown in a parenthesis. If the user has used links in their edit summary, these act as links on the diff page as well. If the editor marked the edit as a
minor edit
appears before the summary.
The "Previous edit" and "Next edit" links lead to earlier or later diffs. When you are viewing the diff between two non-consecutive versions of a page, you will also see the message "(x intermediate revisions not shown.)".
After the table of differences, the latest of the two compared versions is shown fully, unless you have specified in your preferences that this is not to be done.
Linking to a diff
For Linking to an old version of a page, see
Help:Permlink
If you need to create a link to a specific diff (for use on a talk page or noticeboard, for example), it is best to use the [[Special:Diff/
oldid
]] method or
{{
Diff
}}
, which make links work across protocols (
vs.
) and on our mobile site. Alternatively, locate the diff from the
page history
, go to the diff page, and copy the
URL
from your browser's address bar. You can paste this URL (the whole of it, including https://) into the text of the page where you want the link to appear, putting single square brackets [...] around it.
External links
The URL for a diff is based on the
oldid
value of the old revision. If a revision has oldid value 12345678, its URL is:
You can strip the
title=PAGETITLE&
part from the URL and make it look like this:
Then URLs for its diffs may take the forms:
Diff with the current version:
Diff with the previous version:
Diff with version 10000001:
To show only a diff and not the page content, add
&diffonly=1
to any of the above:
A shorter alternative to link to the diff with the previous version is:
Internal links
Although external links are easy to copy and paste, they can be long and unwieldy. Diffs can be wikilinked using [[Special:Diff/
diff
]] (e.g.
Special:Diff/123456789
) or [[Special:Diff/
oldid
diff
]] (e.g.
Special:Diff/100000001/123456789
) where you should replace
oldid
and
diff
with appropriate values seen in the URL. This syntax is easy and can even be used in
edit summaries
{{Diff}} or {{Diff2}}
Using
{{
diff
}}
or
{{
diff2
}}
is another approach of linking to a diff within Wikipedia, though it cannot be used in edit summaries. The general syntax is:
{{
Diff
page
diff
oldid
label
}}
page
– The title of the page.
diff
– The ID or keyword that is used against the base ID. Possible keywords are:
cur
– compare with the current (latest) version of a page.
prev
– compare with the previous version of a page.
next
– compare with the next version of a page.
id
– This should be
larger
than
oldid
oldid
– The base ID onto which the diff is generated.
label
– Text to display as link. No label will give a numbered link.
|diffonly=yes
– Shows only a diff and not the page content. Parameter name required.
{{URL to diff}}
{{
URL to diff
}}
takes a full diff URL and converts it to a
{{
Diff
}}
template. The template should be substituted, thus:
{{Subst:URL to diff|url=https://en.wikipedia.org/w/index.php?diff=100000001&oldid=123456789|label=relevant text}}
Deleted revisions
deleted revision
is to a version of an article that for some reason has been made "invisible" to the general public. This is occasionally done for reasons like significant copyright violations, disruption, or personal attacks on other Wikipedia contributors.
An administrator can see deleted revisions and related diffs, but those diffs can only be shared with other administrators. In order to allow all users to view the diff, the revisions in question need to be visible to them. It is possible for an administrator to restore a deleted revision if warranted.
See
Wikipedia:Revision deletion
for further details.
Weave diffs
When moving or copying a piece of text within a page or from another page, and also making other edits in the same revision, the diff can still compare moved paragraphs, even if weave-moved over 20 paragraphs away. Prior to August 2018, a diff could be kept clearer (simpler), by first using a separate edit to insert blank lines plus move the text paragraphs, then after saving, in further revisions, add or change text within the moved paragraphs. Only if paragraphs are both split and reworded in the same revision, then the specific new words cannot be individually highlighted as different from the prior revision. A split paragraph will typically highlight the 2nd part(s) as if new text on the page. The weave-diff can compare paragraphs word-for-word if moved, but not if split.
A diff shows differences per line, so it synchronizes between revisions by matching the
newlines
and unchanged lines. Some editors find that having additional line breaks to break up the text improves the diff function. Otherwise, those large, massive globs of text can be difficult to compare after a split. Keep sentences limited in length, such as with four prepositions, and seek shorter paragraphs. Long
wp:reftag
footnotes (
...
) may be split with internal newlines as well.
Searching diffs to spot a particular change
If you're trying to find the point in a page's history where a particular change was made, and searching the edit summaries does not help, try taking the diff between points roughly 1/3 and 2/3 of the way through the history. From this diff, you can work out in which of the three parts of the history the change occurred. Repeat this process, narrowing the "search space" by a factor of three each time, until the precise edit where the change was made is identified. You can also use the external
WikiBlame
tool, which automates this searching process.
Format for displaying a diff
In the case of the Classic
skin
with quickbar, the diff page does not have the quickbar, to provide more space. Therefore, the diff page is also useful for viewing the page on full-screen width, without changing the preferences. With the Monobook skin the panels on the left are also on the diff page.
On a diff page, sometimes the whole display might be wider than the screen window, often because some website
URLs
(especially long ones) are not hidden and do not wrap in a diff column. In such cases, you must then use the horizontal scrollbar of the browser to see the whole width of the display. There is no option to wrap the long lines in the diff display.
Comparing different pages
To view a diff between two separate pages (optionally, at specific revisions), use
Special:ComparePages
example
).
Using user scripts
You also can tweak display of your diffs by using various
User scripts
. See
Diffs
subsection for more info.
See also
This page is referenced in the
Wikipedia Glossary
Wikipedia:Complete diff and link guide
— describes some other options and uses.
Wikipedia:Simple diff and link guide
— is simpler! With fewer options! For the newbies!
User:Cacycle/wikEdDiff
— an alternative and often easier to read diff for registered users
Template:Wiki diff
— for simulating diffs
Meta:Help:Diff
Help:Permanent link
WP:Provide diffs
Wikipedia help pages
Visit the
Teahouse
or the
Help desk
for an interactive
Q & A
forum.
FAQs
(?)
Reference desks
(?)
Noticeboards
(?)
Cheatsheet
(?)
Directories
(?)
Village pumps
(?)
About Wikipedia
(?)
Administration
Purpose
Principles
Policies and guidelines
What Wikipedia is not
Disclaimer
parental advice
Making requests
Who writes Wikipedia?
Help for readers
(?)
FAQ
Books
Glossary
Mobile access
Other languages
Saved pages
Searching
Students
Viewing media
Contributing
to Wikipedia
(?)
Advice for young editors
Avoiding common mistakes
Etiquette
Simplified Manual of Style
Simplified rule-set
"Ignore all rules"
"The rules are principles"
Style-tips
Tip of the day
Your first article
article wizard
Getting started
(?)
Why create an account?
Introductions by topic
Graphics tutorials
Picture tutorial
IRC
(live chat)
tutorial
VisualEditor user guide
Dos and don'ts
(?)
Biographies
Biographies (living)
Categorization
Consensus
Discussions
Disambiguation
Images
Leads
Links
Lists
References
Tables
Titles (of articles)
How-to pages
and
information pages
(?)
Appealing blocks
Article deletion
Categories
Citations/references
Referencing for beginners
Citation Style 1
Cite errors
References and page numbers
Convert
Diff
Editing
Minor edit
toolbar
edit conflict
Find sources
Files
Footnotes
Image deletion
Infoboxes
Linking
link color
Logging in
Merging
New page review
Page name
Renaming pages
Redirect
Passwords
Email confirmation
Reverting
Simple vandalism cleanup
Talk pages
archiving
simple archiving
User contributions
WP search protocol
Coding
(?)
Wiki markup
Barcharts
Calculations
Characters
Columns
Elevation
Hidden text
HTML
Lists
Magic words
Music symbols
Sections
Sounds
Tables
Templates
Transclusion
URL
Visual files
Directories
(?)
Abbreviations
AI
Departments
Editor's index
Essays
FAQs
Glossary
Guidelines
Manual of Style
Policies
Tasks
Tips
Tools
Missing Manual
Ask for help on your talk page
(?)
Wikipedia technical help
Get personal technical help at
the Teahouse
help desk
village pump (technical)
talk pages
, or
IRC
General
technical help
Bypass cache
Keyboard shortcuts
Editing
CharInsert
Edit conflict
Edit toolbar
Reverting
How to create a page
IRC
Tutorial
Mobile access
Multilingual support
Page history
Page information
Page name
Help
Printing
Software notices
Editnotice
Special characters
Entering
User access levels
VisualEditor
Help
Special
page
–related
Special page help
AllPages
Edit filter
Emailing users
Logging in
Reset passwords
Logs
Moving a page
History merging
Non-admin and admin-only page moves
Notifications/Echo
FAQ
Page Curation
Page import
Pending changes
Random pages
Recent changes
Related changes
Searching
Linksearch
Tags
User contributions
Watchlist
What links here
Wikitext
Wikitext
Cheatsheet
Columns
Line-break handling
Lists
Magic words
For beginners
Conditional expressions
Switch parser function
Time function
Redirects
Sections and TOCs
Tables
Introduction
Basics
Advanced table formatting
Collapsing
Conditional tables
Sortable tables
Using colours
Links
and
diffs
Links
Interlanguage
Interwiki
Permanent
Diffs
Simplest diff guide
Simple diff and link guide
Complete diff and link guide
Colon trick
Link color
Pipe trick
URLs
Media files
Media help
Files
Creation and usage
Moving files to Commons
Images
Introduction to images
Picture tutorial
Preparing images for upload
Uploading images
Options to hide an image
Extended image syntax
SVG help
Gallery tag
Graphics tutorials
Basic bitmap image editing
How to improve image quality
Graphics Lab resources
Sound file markup
Visual file markup
Other graphics
Family trees
Graphs and charts
How to create
Barcharts
To scale charts
Math formulas
Math symbols
Musical scores
Musical symbols
Timeline
EasyTimeline syntax
WikiHiero syntax
Templates
and
Lua
modules
Templates
Advanced template coding
Template documentation
Template index
Template limits
Template sandbox and test cases
Citation templates
Lua help
Lua project
Resources
To do
Substitution
Purge
Job queue
Transclusion
Labeled section
Costs and benefits
Guide to Scribbling
Data structure
Namespaces
Main/Article
Category
Draft
File
File description page
Help
Portal
Project/Wikipedia
Talk
Archiving
Simple
Template
User
User page design
MediaWiki
Bug reports and feature requests
TimedMediaHandler extension
Module
Special
HTML
and
CSS
Cascading Style Sheets
HTML in wikitext
Catalogue of CSS classes
Common.js and common.css
Classes in microformats
Markup validation
Span tags
Useful styles
Customisation
and tools
Preferences
Gadgets
Skins
Citation tools
Cleaning up vandalism tools
Customizing watchlists
Hide pages
IRC Scripts
User scripts
Guide
List
Techniques
Safe mode
User style
Tools
Alternative browsing
Browser tools
Editing tools
Navigation shortcuts
Optimum tool set
Wikimedia Cloud Services
Beta Features at MediaWiki
Automated editing
AfC helper script
AntiVandal
AutoWikiBrowser
Bots
Creating
history
HotCat
Huggle
Interceptor
Navigation popups
RedWarn
Twinkle
Ultraviolet
WPCleaner
Inactive
igloo
STiki
See also:
Category:Wikipedia how-to
Category:Wikipedia information pages
Further navigation at:
Help pages
Administrators
Accounts
Bots
Referencing
Citation metadata
Templates
User scripts
Retrieved from "
Categories
Wikipedia how-to
Wikipedia glossary items
Wikipedia page history help
Hidden categories:
Wikipedia move-protected project pages
Wikipedia semi-protected project pages
Help
Diff
Add topic
US